├── .gitignore ├── README.md ├── pom.xml ├── service-back ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── xiaoyuan │ │ └── back │ │ ├── BackApplication.java │ │ ├── comm │ │ ├── NoticeListen.java │ │ ├── WebSocketChat.java │ │ └── WebSocketNotice.java │ │ ├── config │ │ ├── CorsConfig.java │ │ ├── MyBatisPlusConfig.java │ │ ├── ThreadPoolConfig.java │ │ ├── WebMVCConfig.java │ │ └── WebSocketConfig.java │ │ ├── constants │ │ ├── QiniuProperties.java │ │ └── WxConstants.java │ │ ├── controller │ │ ├── ArticleController.java │ │ ├── CategoryController.java │ │ ├── CommonUserController.java │ │ ├── FeedbackController.java │ │ ├── FriendLinkController.java │ │ ├── HomeMessageController.java │ │ ├── PermissionController.java │ │ ├── RoleController.java │ │ ├── SysUserController.java │ │ ├── TimeLineController.java │ │ └── UserOperationController.java │ │ ├── handler │ │ ├── IsAdminResolver.java │ │ └── MyMetaObjectHandler.java │ │ ├── interceptor │ │ └── PermissionInterceptor.java │ │ ├── mapper │ │ ├── ArticleCategoryMapper.java │ │ ├── ArticleCollectMapper.java │ │ ├── ArticleCommentMapper.java │ │ ├── ArticleContentMapper.java │ │ ├── ArticleLikeMapper.java │ │ ├── ArticleMapper.java │ │ ├── CategoryMapper.java │ │ ├── CommonUserMapper.java │ │ ├── FriendLinkMapper.java │ │ ├── HomeMessageMapper.java │ │ ├── ProblemFeedbackMapper.java │ │ ├── SuggestFeedbackMapper.java │ │ ├── SysActionMapper.java │ │ ├── SysModuleMapper.java │ │ ├── SysPermissionMapper.java │ │ ├── SysRoleMapper.java │ │ ├── SysUserMapper.java │ │ ├── TimeLineMapper.java │ │ └── UserOperationMapper.java │ │ ├── service │ │ ├── ArticleCategoryService.java │ │ ├── ArticleService.java │ │ ├── CategoryService.java │ │ ├── CommonUserService.java │ │ ├── FriendLinkService.java │ │ ├── HomeMessageService.java │ │ ├── MailService.java │ │ ├── ProblemFeedbackService.java │ │ ├── SuggestFeedbackService.java │ │ ├── SysPermissionService.java │ │ ├── SysRoleService.java │ │ ├── SysUserService.java │ │ ├── ThreadService.java │ │ ├── TimeLineService.java │ │ ├── UserOperationService.java │ │ ├── helper │ │ │ └── CommonUserServiceHelper.java │ │ └── impl │ │ │ ├── ArticleCategoryServiceImpl.java │ │ │ ├── ArticleServiceImpl.java │ │ │ ├── CategoryServiceImpl.java │ │ │ ├── CommonUserServiceImpl.java │ │ │ ├── FriendLinkServiceImpl.java │ │ │ ├── HomeMessageServiceImpl.java │ │ │ ├── MailServiceImpl.java │ │ │ ├── ProblemFeedbackServiceImpl.java │ │ │ ├── SuggestFeedbackServiceImpl.java │ │ │ ├── SysPermissionServiceImpl.java │ │ │ ├── SysRoleServiceImpl.java │ │ │ ├── SysUserServiceImpl.java │ │ │ ├── TimeLineServiceImpl.java │ │ │ └── UserOperationServiceImpl.java │ │ └── task │ │ ├── ArticleTask.java │ │ └── TaskProcessor.java │ └── resources │ ├── application-dev.yml │ ├── application-email.yml │ ├── application.yml │ └── mapper │ ├── ArticleCategoryMapper.xml │ ├── ArticleCollectMapper.xml │ ├── ArticleCommentMapper.xml │ ├── ArticleContentMapper.xml │ ├── ArticleLikeMapper.xml │ ├── ArticleMapper.xml │ ├── CategoryMapper.xml │ ├── CommonUserMapper.xml │ ├── PermissionMapper.xml │ ├── ProblemFeedbackMapper.xml │ ├── RoleMapper.xml │ ├── SysUserMapper.xml │ └── UserOperationMapper.xml ├── service-front ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── xiaoyuan │ │ │ └── front │ │ │ ├── FrontApplication.java │ │ │ ├── annotation │ │ │ ├── AddressRequestLimit.java │ │ │ └── CookieOperation.java │ │ │ ├── aspect │ │ │ ├── RequestLimitAspect.java │ │ │ └── ResponseCookieAspect.java │ │ │ ├── config │ │ │ ├── CorsConfig.java │ │ │ ├── MyBatisPlusConfig.java │ │ │ ├── ThreadPoolConfig.java │ │ │ ├── WebMVCConfig.java │ │ │ ├── XssFilter.java │ │ │ └── XssHttpServletRequestWrapper.java │ │ │ ├── controller │ │ │ ├── AboutMeController.java │ │ │ ├── ArchiveController.java │ │ │ ├── ArticleCommentController.java │ │ │ ├── ArticleController.java │ │ │ ├── ClassifyController.java │ │ │ ├── CommonServiceController.java │ │ │ ├── CommonUserController.java │ │ │ ├── FriendLinkController.java │ │ │ ├── HomeController.java │ │ │ ├── HomeMessageController.java │ │ │ ├── IndexController.java │ │ │ ├── LoginController.java │ │ │ ├── MessageController.java │ │ │ ├── ProblemFeedbackController.java │ │ │ ├── StoryController.java │ │ │ └── TimeLineController.java │ │ │ ├── handler │ │ │ └── MyMetaObjectHandler.java │ │ │ ├── interceptor │ │ │ ├── ErrorInterceptor.java │ │ │ ├── LoginInterceptor.java │ │ │ └── UserPermissionInterceptor.java │ │ │ ├── mapper │ │ │ ├── ArticleCollectMapper.java │ │ │ ├── ArticleCommentMapper.java │ │ │ ├── ArticleContentMapper.java │ │ │ ├── ArticleLikeMapper.java │ │ │ ├── ArticleMapper.java │ │ │ ├── CategoryMapper.java │ │ │ ├── CommonUserMapper.java │ │ │ ├── FriendLinkMapper.java │ │ │ ├── FrontLogMapper.java │ │ │ ├── HomeMessageMapper.java │ │ │ ├── ProblemFeedbackMapper.java │ │ │ ├── SuggestFeedbackMapper.java │ │ │ ├── TimeLineMapper.java │ │ │ └── UserOperationMapper.java │ │ │ ├── service │ │ │ ├── ArticleCollectService.java │ │ │ ├── ArticleCommentService.java │ │ │ ├── ArticleLikeService.java │ │ │ ├── ArticleService.java │ │ │ ├── CategoryService.java │ │ │ ├── CommonService.java │ │ │ ├── CommonUserService.java │ │ │ ├── FriendLinkService.java │ │ │ ├── HomeMessageService.java │ │ │ ├── MailService.java │ │ │ ├── ProblemFeedbackService.java │ │ │ ├── SuggestFeedbackService.java │ │ │ ├── ThreadService.java │ │ │ ├── TimeLineService.java │ │ │ ├── TokenService.java │ │ │ └── impl │ │ │ │ ├── ArticleCollectServiceImpl.java │ │ │ │ ├── ArticleCommentServiceImpl.java │ │ │ │ ├── ArticleLikeServiceImpl.java │ │ │ │ ├── ArticleServiceImpl.java │ │ │ │ ├── CategoryServiceImpl.java │ │ │ │ ├── CommonUserServiceImpl.java │ │ │ │ ├── FriendLinkServiceImpl.java │ │ │ │ ├── HomeMessageServiceImpl.java │ │ │ │ ├── MailServiceImpl.java │ │ │ │ ├── ProblemFeedbackServiceImpl.java │ │ │ │ ├── SuggestFeedbackServiceImpl.java │ │ │ │ ├── TimeLineServiceImpl.java │ │ │ │ └── TokenServiceImpl.java │ │ │ ├── utils │ │ │ ├── StringThreadLocal.java │ │ │ └── UserThreadLocal.java │ │ │ └── vo │ │ │ ├── ArchivesVo.java │ │ │ ├── CategoryVo.java │ │ │ ├── CommonUserVo.java │ │ │ ├── HomeMessageVo.java │ │ │ └── param │ │ │ ├── ArticleCommentParam.java │ │ │ ├── CodeParam.java │ │ │ ├── ConditionParam.java │ │ │ ├── HomeMessageParam.java │ │ │ ├── MailParam.java │ │ │ └── ProblemFeedbackParam.java │ └── resources │ │ ├── application-dev.yml │ │ ├── application-email.yml │ │ ├── application.yml │ │ ├── mapper │ │ ├── ArticleCollectMapper.xml │ │ ├── ArticleCommentMapper.xml │ │ ├── ArticleContentMapper.xml │ │ ├── ArticleLikeMapper.xml │ │ ├── ArticleMapper.xml │ │ ├── CategoryMapper.xml │ │ ├── CommonUserMapper.xml │ │ ├── FriendLinkMapper.xml │ │ ├── HomeMessageMapper.xml │ │ └── TimeLineMapper.xml │ │ ├── static │ │ ├── component │ │ │ ├── dialog │ │ │ │ └── feedback.vue │ │ │ └── navbar │ │ │ │ └── index.vue │ │ ├── css │ │ │ ├── animate.css │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── customer │ │ │ │ ├── classify.css │ │ │ │ ├── common.css │ │ │ │ ├── detail.css │ │ │ │ ├── error.css │ │ │ │ ├── example.css │ │ │ │ ├── footer&cbl.css │ │ │ │ ├── header.css │ │ │ │ ├── home.css │ │ │ │ ├── index.css │ │ │ │ ├── login.css │ │ │ │ ├── message.css │ │ │ │ └── player.min.css │ │ │ ├── element-ui.css │ │ │ ├── font-awesome.css │ │ │ ├── fonts │ │ │ │ ├── element-icons.ttf │ │ │ │ └── element-icons.woff │ │ │ ├── hplus.css │ │ │ ├── sideBar │ │ │ │ └── sidebar.css │ │ │ └── xy-iconfont.css │ │ ├── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ ├── fontawesome-webfont.woff2 │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ ├── glyphicons-halflings-regular.woff2 │ │ │ ├── player │ │ │ │ ├── icon.eot │ │ │ │ ├── icon.svg │ │ │ │ ├── icon.ttf │ │ │ │ └── icon.woff │ │ │ ├── xy-iconfont.ttf │ │ │ ├── xy-iconfont.woff │ │ │ └── xy-iconfont.woff2 │ │ ├── img │ │ │ ├── appreciate.jpg │ │ │ ├── appreciate1.jpg │ │ │ ├── b.jpg │ │ │ ├── bg.jpg │ │ │ ├── bg │ │ │ │ ├── TimeLine.jpg │ │ │ │ ├── aboutme_bg.jpg │ │ │ │ ├── archive_bg.jpg │ │ │ │ ├── classify_bg.jpg │ │ │ │ ├── friendlink_bg.jpg │ │ │ │ ├── home.jpg │ │ │ │ ├── login-form_bg.jpg │ │ │ │ ├── login_bg.jpg │ │ │ │ ├── message.jpg │ │ │ │ ├── story_bg.jpg │ │ │ │ ├── xinhua_1.jpg │ │ │ │ ├── xinhua_2.jpg │ │ │ │ ├── xinhua_4.jpg │ │ │ │ └── xinhua_5.jpg │ │ │ ├── favicon.ico │ │ │ ├── home_background.jpg │ │ │ ├── icon │ │ │ │ ├── collectActive.png │ │ │ │ ├── collectNoActive.png │ │ │ │ ├── commentNoActive.png │ │ │ │ ├── likeActive.png │ │ │ │ └── likeNoActive.png │ │ │ ├── logo.png │ │ │ ├── pic.png │ │ │ ├── qq_group.jpg │ │ │ └── social_icon_24x24.png │ │ ├── js │ │ │ ├── api │ │ │ │ ├── article.js │ │ │ │ ├── articleComment.js │ │ │ │ ├── classify.js │ │ │ │ ├── commonService.js │ │ │ │ ├── feedback.js │ │ │ │ ├── friendlink.js │ │ │ │ ├── message.js │ │ │ │ ├── timeline.js │ │ │ │ └── user.js │ │ │ ├── axios.min.js │ │ │ ├── bootstrap.js │ │ │ ├── common │ │ │ │ ├── dialog │ │ │ │ │ └── feedback.js │ │ │ │ └── navbar │ │ │ │ │ └── userOperation.js │ │ │ ├── content.min.js │ │ │ ├── customer │ │ │ │ ├── index.js │ │ │ │ ├── music.js │ │ │ │ ├── player.min.js │ │ │ │ └── template.js │ │ │ ├── element-ui.js │ │ │ ├── httpVueLoader.js │ │ │ ├── jquery-1.11.3.js │ │ │ ├── leEditor.js │ │ │ ├── leEditor.js.map │ │ │ ├── test.js │ │ │ ├── utils │ │ │ │ ├── commonUtil.js │ │ │ │ ├── request.js │ │ │ │ └── validator.js │ │ │ └── vue.js │ │ └── video │ │ │ └── home_background.mp4 │ │ └── templates │ │ ├── aboutme │ │ └── aboutMe.html │ │ ├── archive │ │ └── archive.html │ │ ├── classify │ │ └── classify.html │ │ ├── common │ │ ├── common.html │ │ └── commonSidebar.html │ │ ├── error │ │ ├── 404.html │ │ └── 500.html │ │ ├── friendlink │ │ └── friendLink.html │ │ ├── home │ │ ├── article_detail.html │ │ └── home.html │ │ ├── index.html │ │ ├── login.html │ │ ├── message │ │ └── message.html │ │ ├── story │ │ └── story.html │ │ └── timeline │ │ └── timeLine.html │ └── test │ └── java │ └── com │ └── xiaoyuan │ └── front │ └── FrontApplicationTest.java ├── xiaoyuanboke-vue ├── .babelrc ├── .editorconfig ├── .gitignore ├── .postcssrc.js ├── .travis.yml ├── LICENSE ├── README.en.md ├── README.md ├── build │ ├── build.js │ ├── check-versions.js │ ├── logo.png │ ├── utils.js │ ├── vue-loader.conf.js │ ├── webpack.base.conf.js │ ├── webpack.dev.conf.js │ └── webpack.prod.conf.js ├── config │ ├── dev.env.js │ ├── index.js │ └── prod.env.js ├── favicon.ico ├── index.html ├── package-lock.json ├── package.json ├── src │ ├── App.vue │ ├── api │ │ ├── blog │ │ │ ├── article.js │ │ │ ├── category.js │ │ │ ├── feedback.js │ │ │ ├── friendlink.js │ │ │ ├── homeMessage.js │ │ │ └── timeline.js │ │ ├── login.js │ │ ├── system │ │ │ ├── permission.js │ │ │ ├── role.js │ │ │ └── sysUser.js │ │ ├── user.js │ │ └── utils │ │ │ └── qiniu.js │ ├── assets │ │ ├── 404_images │ │ │ ├── 404.png │ │ │ └── 404_cloud.png │ │ └── img │ │ │ ├── login_bg.jpg │ │ │ ├── logo.png │ │ │ ├── weixinActive.png │ │ │ └── weixinNoActive.png │ ├── components │ │ ├── Breadcrumb │ │ │ └── index.vue │ │ ├── GithubCorner │ │ │ └── index.vue │ │ ├── Hamburger │ │ │ └── index.vue │ │ ├── NoticeDrawer │ │ │ └── index.vue │ │ ├── Pagination │ │ │ └── index.vue │ │ ├── PanThumb │ │ │ └── index.vue │ │ ├── SvgIcon │ │ │ └── index.vue │ │ └── TextHoverEffect │ │ │ └── Mallki.vue │ ├── icons │ │ ├── index.js │ │ └── svg │ │ │ ├── add.svg │ │ │ ├── address.svg │ │ │ ├── article.svg │ │ │ ├── article_publish.svg │ │ │ ├── category.svg │ │ │ ├── draft.svg │ │ │ ├── example.svg │ │ │ ├── eye.svg │ │ │ ├── feedback.svg │ │ │ ├── form.svg │ │ │ ├── friend.svg │ │ │ ├── link.svg │ │ │ ├── list.svg │ │ │ ├── log.svg │ │ │ ├── message.svg │ │ │ ├── notice.svg │ │ │ ├── password.svg │ │ │ ├── permission.svg │ │ │ ├── problem.svg │ │ │ ├── publish.svg │ │ │ ├── renew.svg │ │ │ ├── role.svg │ │ │ ├── running.svg │ │ │ ├── suggest.svg │ │ │ ├── system.svg │ │ │ ├── time.svg │ │ │ ├── user.svg │ │ │ ├── user_operation.svg │ │ │ ├── wait.svg │ │ │ └── wx.svg │ ├── main.js │ ├── permission.js │ ├── router │ │ └── index.js │ ├── store │ │ ├── getters.js │ │ ├── index.js │ │ └── modules │ │ │ ├── app.js │ │ │ └── user.js │ ├── styles │ │ ├── element-ui.scss │ │ ├── index.scss │ │ ├── mixin.scss │ │ ├── sidebar.scss │ │ ├── transition.scss │ │ ├── variables.scss │ │ └── xy │ │ │ ├── iconfont.css │ │ │ ├── iconfont.ttf │ │ │ ├── iconfont.woff │ │ │ └── iconfont.woff2 │ ├── utils │ │ ├── auth.js │ │ ├── index.js │ │ ├── json │ │ │ └── article.json │ │ └── request.js │ └── views │ │ ├── 404.vue │ │ ├── article │ │ ├── components │ │ │ └── query.vue │ │ ├── detail │ │ │ └── index.vue │ │ ├── draft │ │ │ └── index.vue │ │ ├── list │ │ │ └── index.vue │ │ ├── publish │ │ │ └── index.vue │ │ └── schedule │ │ │ └── index.vue │ │ ├── category │ │ └── index.vue │ │ ├── dashboard │ │ ├── components │ │ │ └── BoxCard.vue │ │ └── index.vue │ │ ├── feedback │ │ ├── problem │ │ │ ├── components │ │ │ │ └── query.vue │ │ │ └── index.vue │ │ └── suggest │ │ │ └── index.vue │ │ ├── friendlink │ │ └── index.vue │ │ ├── layout │ │ ├── Layout.vue │ │ ├── components │ │ │ ├── AppMain.vue │ │ │ ├── Navbar.vue │ │ │ ├── Sidebar │ │ │ │ ├── Item.vue │ │ │ │ ├── Link.vue │ │ │ │ ├── Logo.vue │ │ │ │ ├── SidebarItem.vue │ │ │ │ └── index.vue │ │ │ └── index.js │ │ └── mixin │ │ │ └── ResizeHandler.js │ │ ├── login │ │ ├── index.vue │ │ └── wxLogin.js │ │ ├── message │ │ └── index.vue │ │ ├── notice │ │ ├── article │ │ │ └── index.vue │ │ └── renew │ │ │ └── index.vue │ │ ├── system │ │ ├── permission │ │ │ ├── components │ │ │ │ ├── PermissionSelect │ │ │ │ │ └── index.vue │ │ │ │ ├── action │ │ │ │ │ └── index.vue │ │ │ │ ├── module │ │ │ │ │ └── index.vue │ │ │ │ └── permissionList │ │ │ │ │ └── index.vue │ │ │ └── index.vue │ │ ├── role │ │ │ ├── components │ │ │ │ └── addRole.vue │ │ │ └── index.vue │ │ └── user │ │ │ ├── components │ │ │ └── userList │ │ │ │ └── index.vue │ │ │ └── index.vue │ │ ├── timeline │ │ ├── index.vue │ │ └── save │ │ │ └── index.vue │ │ └── user │ │ ├── index.vue │ │ └── operation.vue └── static │ └── .gitkeep ├── xiaoyuanboke.sql └── xy-common ├── pom.xml └── src └── main ├── java └── com │ └── xiaoyuan │ └── common │ ├── annotation │ ├── IsAdmin.java │ └── MultiRequestBody.java │ ├── config │ └── SwaggerConfig.java │ ├── constants │ ├── CookieConstant.java │ ├── MatchConstants.java │ ├── MessageQueueConstants.java │ ├── RedisConstantKey.java │ ├── ResultCode.java │ ├── defaults │ │ └── SystemDefaultConstants.java │ └── valid │ │ ├── NotChinese.java │ │ ├── NotEmoji.java │ │ └── Number.java │ ├── convert │ └── TextOperation.java │ ├── enums │ ├── BaseCodeEnum.java │ ├── HttpStatusEnum.java │ ├── JobStateEnum.java │ └── MessageEnum.java │ ├── exception │ ├── CustomerException.java │ └── GlobalExceptionHandler.java │ ├── handle │ └── MultiRequestBodyArgumentResolver.java │ ├── log │ ├── aspect │ │ └── GlobalLogAspect.java │ ├── config │ │ ├── InitAutoConfiguration.java │ │ ├── InitSystemLogConfiguration.java │ │ └── LogNoticeConfig.java │ ├── model │ │ └── MiscroCloudSystemLog.java │ ├── service │ │ └── LogNotice.java │ └── utils │ │ └── IpUtil.java │ ├── param │ ├── ArticleContentParam.java │ ├── ArticleParam.java │ ├── CategoryParam.java │ ├── MessageParam.java │ ├── MessageSenderParam.java │ ├── SendSmsCodeParam.java │ ├── UserOperationParam.java │ ├── UserQueryParam.java │ ├── article │ │ ├── ArticleLikeParam.java │ │ ├── ArticleQueryParam.java │ │ ├── CategoryQueryParam.java │ │ └── CommentDeleteParam.java │ ├── comuser │ │ ├── FindPasswordParam.java │ │ ├── LoginParam.java │ │ ├── ModifyPasswordParam.java │ │ └── RegisterParam.java │ ├── mail │ │ ├── SendMailCodeParam.java │ │ └── SendMailParam.java │ ├── permission │ │ ├── DeleteActParam.java │ │ ├── DeleteModParam.java │ │ ├── InsertActParam.java │ │ ├── InsertModParam.java │ │ ├── UpdateActParam.java │ │ └── UpdateModParam.java │ ├── problem │ │ └── ProblemQueryParam.java │ ├── role │ │ ├── DeleteRoleParam.java │ │ ├── InsertRoleParam.java │ │ ├── PermissionRoleParam.java │ │ └── RoleQueryParam.java │ └── sysuser │ │ ├── SysUserLoginParam.java │ │ ├── SysUserParam.java │ │ ├── SysUserQueryParam.java │ │ └── WeChatRegisterParam.java │ ├── pojo │ ├── Article.java │ ├── ArticleCategory.java │ ├── ArticleCollect.java │ ├── ArticleComment.java │ ├── ArticleContent.java │ ├── ArticleLike.java │ ├── Category.java │ ├── CommonUser.java │ ├── FriendLink.java │ ├── FrontLog.java │ ├── HomeMessage.java │ ├── Job.java │ ├── ProblemFeedback.java │ ├── SuggestFeedback.java │ ├── SysAction.java │ ├── SysModule.java │ ├── SysNotice.java │ ├── SysPermission.java │ ├── SysRole.java │ ├── SysUser.java │ ├── TimeLine.java │ └── UserOperation.java │ ├── util │ ├── ConverterUtil.java │ ├── DateConverterUtil.java │ ├── EncryptionAlgorithmUtil.java │ ├── ExceptionUtil.java │ ├── JWTUtil.java │ ├── NetUtil.java │ ├── RandomUtil.java │ ├── StateCodeUtil.java │ └── StringMatch.java │ └── vo │ ├── BaseMessage.java │ ├── CommonUserVo.java │ ├── FriendLinkVo.java │ ├── HomeMessageVo.java │ ├── PageUtils.java │ ├── PageVo.java │ ├── Pagination.java │ ├── ProblemFeedbackVo.java │ ├── R.java │ ├── SysNoticeVo.java │ ├── SysPermissionVo.java │ ├── SysRoleVo.java │ ├── TimeLineVo.java │ ├── UserOperationVo.java │ ├── article │ ├── ArticleCommentVo.java │ ├── ArticleOperationVo.java │ ├── ArticlePublishVo.java │ ├── ArticleVo.java │ └── RecommendArticleVo.java │ ├── category │ ├── CategoryChildrenVo.java │ ├── CategoryNameVo.java │ ├── CategoryParentVo.java │ └── CategoryVo.java │ └── sysuser │ ├── SysUserVo.java │ └── WxVo.java └── resources ├── META-INF ├── additional-spring-configuration-metadata.json └── spring.factories └── logback-spring.xml /.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | # Zeppelin ignored files 10 | /ZeppelinRemoteNotebooks/ 11 | 12 | #idea 13 | *.iml 14 | target/ 15 | out/ 16 | *.class 17 | *.idea/ 18 | *.log 19 | logs/ 20 | /xiaoyuanboke-logs 21 | application-prod.yml -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/config/CorsConfig.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 6 | 7 | @Configuration 8 | public class CorsConfig implements WebMvcConfigurer{ 9 | @Override 10 | public void addCorsMappings(CorsRegistry registry) { 11 | registry.addMapping("/**") 12 | .allowedOrigins("*") 13 | .allowedMethods("POST", "GET", "PUT", "OPTIONS", "DELETE") 14 | .maxAge(3600) 15 | .allowCredentials(true); 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/config/MyBatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.config; 2 | 3 | import com.baomidou.mybatisplus.annotation.DbType; 4 | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; 5 | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | /** 10 | * FileName: MyBatisPlusConfig 11 | * Author: 小袁 12 | * Date: 2022/4/16 11:29 13 | * Description: 14 | */ 15 | @Configuration 16 | public class MyBatisPlusConfig { 17 | 18 | /** 19 | * 分页插件 20 | * @return 21 | */ 22 | @Bean 23 | public MybatisPlusInterceptor mybatisPlusInterceptor() { 24 | MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); 25 | //分页插件 26 | interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); 27 | return interceptor; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/config/WebSocketConfig.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.config; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.web.socket.config.annotation.EnableWebSocket; 8 | import org.springframework.web.socket.config.annotation.WebSocketConfigurer; 9 | import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry; 10 | import org.springframework.web.socket.server.standard.ServerEndpointExporter; 11 | 12 | @Slf4j 13 | @Configuration 14 | public class WebSocketConfig { 15 | 16 | /** 17 | * 注入ServerEndpointExporter, 18 | * 这个bean会自动注册使用了@ServerEndpoint注解声明的Websocket endpoint 19 | */ 20 | @Bean 21 | public ServerEndpointExporter serverEndpointExporter() { 22 | return new ServerEndpointExporter(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/constants/QiniuProperties.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.constants; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | import javax.annotation.PostConstruct; 8 | 9 | /** 10 | * @Author: YDW 11 | * @Date: 2023-04-21 16:39 12 | */ 13 | @Data 14 | @Configuration 15 | @ConfigurationProperties(prefix = "qiniu") 16 | public class QiniuProperties { 17 | 18 | private String accessKey; 19 | private String secretKey; 20 | private String bucket; 21 | private String urlPrefix; 22 | 23 | public static String ACCESS_KEY; 24 | public static String SECRET_KEY; 25 | public static String BUCKET; 26 | public static String URL_PREFIX; 27 | 28 | @PostConstruct 29 | public void init() { 30 | ACCESS_KEY = this.accessKey; 31 | SECRET_KEY = this.secretKey; 32 | BUCKET = this.bucket; 33 | URL_PREFIX = this.urlPrefix; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/constants/WxConstants.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.constants; 2 | 3 | import org.springframework.boot.context.properties.ConfigurationProperties; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | import javax.annotation.PostConstruct; 7 | 8 | @Configuration 9 | @ConfigurationProperties(prefix = "wx") 10 | public class WxConstants { 11 | 12 | private String appId; 13 | private String appSecret; 14 | private String callbackUrl; 15 | private String phoneBindingUrl; 16 | private String loginUrl; 17 | private String homeUrl; 18 | 19 | public static String APP_ID; 20 | public static String APP_SECRET; 21 | public static String CALLBACK_URL; 22 | public static String PHONE_BINDING_URL; 23 | public static String LOGIN_URL; 24 | public static String HOME_URL; 25 | 26 | @PostConstruct 27 | public void init() { 28 | APP_ID = this.appId; 29 | APP_SECRET = this.appSecret; 30 | CALLBACK_URL = this.callbackUrl; 31 | PHONE_BINDING_URL = this.phoneBindingUrl; 32 | LOGIN_URL = this.loginUrl; 33 | HOME_URL = this.homeUrl; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/controller/UserOperationController.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.controller; 2 | 3 | import com.xiaoyuan.back.service.UserOperationService; 4 | import com.xiaoyuan.common.vo.R; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | /** 11 | * FileName: UserOperationController 12 | * Author: 小袁教程 13 | * Date: 2022/6/7 12:40 14 | * Description: 15 | */ 16 | @RestController 17 | @RequestMapping("/userOperation") 18 | public class UserOperationController { 19 | 20 | @Autowired 21 | private UserOperationService userOperationService; 22 | 23 | @GetMapping("/type") 24 | public R selectUserOperationTypeList() { 25 | return userOperationService.selectOperationType(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/mapper/ArticleCategoryMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.ArticleCategory; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * FileName: ArticleCategoryMapper 11 | * Author: 小袁 12 | * Date: 2022/4/16 18:10 13 | * Description: 14 | */ 15 | @Repository 16 | public interface ArticleCategoryMapper extends BaseMapper { 17 | 18 | /** 19 | * 根据文章编号查询他的所属分类 20 | * @param articleId 21 | * @return 22 | */ 23 | List findCategoryIdsByArticleId(Long articleId); 24 | } 25 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/mapper/ArticleCollectMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.ArticleCollect; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * FileName: ArticleCollectMapper 9 | * Author: 小袁 10 | * Date: 2022/5/11 9:27 11 | * Description: 12 | */ 13 | @Repository 14 | public interface ArticleCollectMapper extends BaseMapper { 15 | 16 | int removeByArticleId(long articleId); 17 | } 18 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/mapper/ArticleCommentMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.ArticleComment; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * FileName: ArticleCommentMapper 9 | * Author: 小袁 10 | * Date: 2022/5/3 19:30 11 | * Description: 12 | */ 13 | @Repository 14 | public interface ArticleCommentMapper extends BaseMapper { 15 | 16 | int removeByArticleId(long articleId); 17 | } 18 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/mapper/ArticleContentMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.ArticleContent; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * FileName: ArticleContentMapper 9 | * Author: 小袁 10 | * Date: 2022/4/16 18:35 11 | * Description: 12 | */ 13 | @Repository 14 | public interface ArticleContentMapper extends BaseMapper { 15 | 16 | /** 17 | * 根据文章编号获取Markdown文本 18 | * @param id 19 | * @return 20 | */ 21 | String getArticleMarkdownById(Long id); 22 | } 23 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/mapper/ArticleLikeMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.ArticleLike; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * FileName: ArticleLikeMapper 9 | * Author: 小袁 10 | * Date: 2022/5/11 9:28 11 | * Description: 12 | */ 13 | @Repository 14 | public interface ArticleLikeMapper extends BaseMapper { 15 | 16 | int removeByArticleId(long articleId); 17 | } 18 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/mapper/ArticleMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.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.xiaoyuan.common.pojo.Article; 7 | import com.xiaoyuan.common.param.article.ArticleQueryParam; 8 | import com.xiaoyuan.common.vo.article.ArticleVo; 9 | import org.apache.ibatis.annotations.Param; 10 | import org.springframework.stereotype.Repository; 11 | 12 | 13 | /** 14 | * FileName: ArticleMapper 15 | * Author: 小袁 16 | * Date: 2022/4/16 11:23 17 | * Description: 文章DAO 18 | */ 19 | @Repository 20 | public interface ArticleMapper extends BaseMapper
{ 21 | 22 | IPage listArticlePage(Page page, @Param("param") ArticleQueryParam articleQueryParam); 23 | } 24 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/mapper/CommonUserMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.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.xiaoyuan.common.pojo.CommonUser; 7 | import com.xiaoyuan.common.param.UserQueryParam; 8 | import com.xiaoyuan.common.vo.CommonUserVo; 9 | import org.apache.ibatis.annotations.Param; 10 | import org.springframework.stereotype.Repository; 11 | 12 | /** 13 | * FileName: CommonUserMapper 14 | * Author: 小袁 15 | * Date: 2022/4/17 17:25 16 | * Description: 普通用户DAO 17 | */ 18 | @Repository 19 | public interface CommonUserMapper extends BaseMapper { 20 | 21 | IPage listCommonUserPage(Page page, @Param("param") UserQueryParam userQueryParam); 22 | 23 | int findTotal(); 24 | } 25 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/mapper/FriendLinkMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.FriendLink; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * FileName: FriendLinkMapper 9 | * Author: 小袁 10 | * Date: 2022/4/30 15:05 11 | * Description: 12 | */ 13 | @Repository 14 | public interface FriendLinkMapper extends BaseMapper { 15 | } 16 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/mapper/HomeMessageMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.HomeMessage; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * FileName: HomeMessageMapper 9 | * Author: 小袁 10 | * Date: 2022/4/27 20:17 11 | * Description: 12 | */ 13 | @Repository 14 | public interface HomeMessageMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/mapper/ProblemFeedbackMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.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.xiaoyuan.common.pojo.ProblemFeedback; 7 | import com.xiaoyuan.common.param.problem.ProblemQueryParam; 8 | import com.xiaoyuan.common.vo.ProblemFeedbackVo; 9 | import org.apache.ibatis.annotations.Param; 10 | import org.springframework.stereotype.Repository; 11 | 12 | /** 13 | * FileName: ProblemFeedbackMapper 14 | * Author: 小袁 15 | * Date: 2022/4/21 8:46 16 | * Description: 17 | */ 18 | @Repository 19 | public interface ProblemFeedbackMapper extends BaseMapper { 20 | 21 | String getProblemFeedbackStateById(Long id); 22 | 23 | IPage listProblemFeedbackPage(Page page, @Param("param") ProblemQueryParam problemQueryParam); 24 | } 25 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/mapper/SuggestFeedbackMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.SuggestFeedback; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * FileName: SuggestFeedbackMapper 9 | * Author: 小袁 10 | * Date: 2022/4/28 19:11 11 | * Description: 12 | */ 13 | @Repository 14 | public interface SuggestFeedbackMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/mapper/SysActionMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.SysAction; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface SysActionMapper extends BaseMapper { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/mapper/SysModuleMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.SysModule; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface SysModuleMapper extends BaseMapper { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/mapper/SysPermissionMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.SysPermission; 5 | import com.xiaoyuan.common.param.role.PermissionRoleParam; 6 | import com.xiaoyuan.common.vo.SysPermissionVo; 7 | import org.springframework.stereotype.Repository; 8 | 9 | import java.util.List; 10 | 11 | @Repository 12 | public interface SysPermissionMapper extends BaseMapper { 13 | 14 | List getPermissionList(); 15 | 16 | List getPermissionListByRoleKey(PermissionRoleParam roleParam); 17 | } 18 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/mapper/SysRoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.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.xiaoyuan.common.pojo.SysRole; 7 | import com.xiaoyuan.common.param.role.PermissionRoleParam; 8 | import com.xiaoyuan.common.param.role.RoleQueryParam; 9 | import com.xiaoyuan.common.vo.SysRoleVo; 10 | import org.apache.ibatis.annotations.Param; 11 | import org.springframework.stereotype.Repository; 12 | 13 | @Repository 14 | public interface SysRoleMapper extends BaseMapper { 15 | 16 | IPage listRolePage(Page page, @Param("param") RoleQueryParam roleQueryParam); 17 | 18 | int updatePermissions(PermissionRoleParam permissionRoleParam); 19 | 20 | int insertRole(SysRole SysRole); 21 | } 22 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/mapper/SysUserMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.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.xiaoyuan.common.pojo.SysUser; 7 | import com.xiaoyuan.common.param.sysuser.SysUserQueryParam; 8 | import com.xiaoyuan.common.vo.sysuser.SysUserVo; 9 | import org.apache.ibatis.annotations.Param; 10 | import org.springframework.stereotype.Repository; 11 | 12 | import java.util.Set; 13 | 14 | @Repository 15 | public interface SysUserMapper extends BaseMapper { 16 | 17 | IPage getSysUserList(Page page, @Param("param") SysUserQueryParam sysUserQueryParam); 18 | 19 | SysUserVo getInfoById(Integer id); 20 | 21 | Set searchUserPermissions(Integer id); 22 | 23 | Set searchUserRoles(Integer id); 24 | 25 | String searchUserCodeByArticleId(String articleId); 26 | } 27 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/mapper/TimeLineMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.TimeLine; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * FileName: TimeLineMapper 9 | * Author: 小袁 10 | * Date: 2022/4/20 12:27 11 | * Description: 12 | */ 13 | @Repository 14 | public interface TimeLineMapper extends BaseMapper { 15 | } 16 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/mapper/UserOperationMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.UserOperation; 5 | import com.xiaoyuan.common.vo.UserOperationVo; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.HashMap; 9 | import java.util.List; 10 | 11 | /** 12 | * FileName: UserOperationMapper 13 | * Author: 小袁教程 14 | * Date: 2022/5/17 15:47 15 | * Description: 16 | */ 17 | @Repository 18 | public interface UserOperationMapper extends BaseMapper { 19 | 20 | List selectUserOperationList(HashMap map); 21 | 22 | int findTotal(HashMap map); 23 | 24 | List selectOperationType(); 25 | } 26 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/service/ArticleCategoryService.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.service; 2 | 3 | 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | import com.xiaoyuan.common.pojo.ArticleCategory; 6 | 7 | /** 8 | * FileName: ArticleCategoryService 9 | * Author: 小袁 10 | * Date: 2022/4/16 18:10 11 | * Description: 文章表和文章分类表中间表业务 12 | */ 13 | public interface ArticleCategoryService extends IService { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/service/CommonUserService.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.xiaoyuan.common.vo.PageVo; 5 | import com.xiaoyuan.common.pojo.CommonUser; 6 | import com.xiaoyuan.common.param.UserQueryParam; 7 | import com.xiaoyuan.common.param.sysuser.SysUserParam; 8 | import com.xiaoyuan.common.vo.CommonUserVo; 9 | import com.xiaoyuan.common.vo.R; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * FileName: CommonUserService 15 | * Author: 小袁 16 | * Date: 2022/4/17 17:29 17 | * Description: 18 | */ 19 | public interface CommonUserService extends IService { 20 | 21 | /** 22 | * 根据用户编号查询用户昵称 23 | * @param userId 24 | * @return 25 | */ 26 | CommonUserVo getCommonUserInfoById(Long userId); 27 | 28 | /** 29 | * 分页查询 30 | */ 31 | R>> selectUserList(UserQueryParam queryParam); 32 | 33 | /** 34 | * 加入黑名单 35 | */ 36 | R pullBlackById(SysUserParam sysUserParam); 37 | } 38 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/service/FriendLinkService.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.xiaoyuan.common.pojo.FriendLink; 5 | import com.xiaoyuan.common.vo.R; 6 | 7 | /** 8 | * FileName: FriendLinkService 9 | * Author: 小袁 10 | * Date: 2022/4/30 15:10 11 | * Description: 12 | */ 13 | public interface FriendLinkService extends IService { 14 | 15 | /** 16 | * 添加一条友链 17 | * @param friendLink 18 | * @return 19 | */ 20 | R insert(FriendLink friendLink); 21 | 22 | /** 23 | * 删除一条友链 24 | * @param id 25 | * @return 26 | */ 27 | R deleteById(Integer id); 28 | 29 | /** 30 | * 编辑 31 | * @param friendLink 32 | * @return 33 | */ 34 | R modifyById(FriendLink friendLink); 35 | 36 | /** 37 | * 分页查询友链 38 | * @return 39 | */ 40 | R listFriendLinkPage(Integer pageIndex, Integer pageSize); 41 | } 42 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/service/HomeMessageService.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.xiaoyuan.common.pojo.HomeMessage; 5 | import com.xiaoyuan.common.vo.R; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * FileName: HomeMessageService 11 | * Author: 小袁 12 | * Date: 2022/5/1 0:23 13 | * Description: 14 | */ 15 | public interface HomeMessageService extends IService { 16 | 17 | /** 18 | * 单个删除 19 | * @param id 20 | * @return 21 | */ 22 | R delete(String id); 23 | 24 | /** 25 | * 多次删除 26 | * @param ids 27 | * @return 28 | */ 29 | R deleteMore(List ids); 30 | 31 | /** 32 | * 编辑 33 | * @param homeMessage 34 | * @return 35 | */ 36 | R modify(HomeMessage homeMessage); 37 | 38 | /** 39 | * 分页查询 40 | * @param pageIndex 41 | * @param pageSize 42 | * @return 43 | */ 44 | R listHomeMessagePage(Integer pageIndex, Integer pageSize); 45 | } 46 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/service/MailService.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.service; 2 | 3 | import javax.mail.MessagingException; 4 | import java.io.UnsupportedEncodingException; 5 | 6 | public interface MailService { 7 | 8 | /** 9 | * 发送简单的邮箱 10 | * 11 | * @param to 收件人 12 | * @param theme 标题 13 | * @param content 正文内容 14 | * @param cc 抄送 15 | */ 16 | void sendSampleMail(String to, String theme, String content, String... cc) throws UnsupportedEncodingException; 17 | 18 | /** 19 | * 发送HTML邮件 20 | * 21 | * @param to 收件人地址 22 | * @param subject 邮件主题 23 | * @param content 邮件内容 24 | * @param cc 抄送地址 25 | * @throws MessagingException 邮件发送异常 26 | */ 27 | void sendHtmlMail(String to, String subject, String content, String... cc) throws MessagingException; 28 | } 29 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/service/ProblemFeedbackService.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.xiaoyuan.common.pojo.ProblemFeedback; 5 | import com.xiaoyuan.common.param.problem.ProblemQueryParam; 6 | import com.xiaoyuan.common.vo.ProblemFeedbackVo; 7 | import com.xiaoyuan.common.vo.R; 8 | 9 | /** 10 | * FileName: ProblemFeedbackService 11 | * Author: 小袁 12 | * Date: 2022/4/21 8:47 13 | * Description: 14 | */ 15 | public interface ProblemFeedbackService extends IService { 16 | 17 | /** 18 | * 删除问题 19 | */ 20 | R delete(Long id); 21 | 22 | /** 23 | * 编辑问题状态 24 | */ 25 | R modifyProblemState(ProblemFeedbackVo problemFeedbackVo); 26 | 27 | /** 28 | * 分页查询 29 | */ 30 | R listProblemFeedbackPage(ProblemQueryParam problemQueryParam); 31 | 32 | /** 33 | * 邮件通知用户问题解决 34 | */ 35 | R noticeUserProblemIsOk(ProblemFeedbackVo problemFeedbackVo); 36 | } 37 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/service/SuggestFeedbackService.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.xiaoyuan.common.pojo.SuggestFeedback; 5 | import com.xiaoyuan.common.vo.R; 6 | 7 | /** 8 | * FileName: SuggestFeedbackService 9 | * Author: 小袁 10 | * Date: 2022/4/28 19:11 11 | * Description: 12 | */ 13 | public interface SuggestFeedbackService extends IService { 14 | 15 | /** 16 | * 查询所有建议列表 17 | * @return 18 | */ 19 | R listSuggestPage(Integer pageIndex, Integer pageSize); 20 | 21 | /** 22 | * 删除 23 | * @param id 24 | * @return 25 | */ 26 | R deleteById(Integer id); 27 | } 28 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/service/SysRoleService.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.xiaoyuan.common.vo.PageVo; 5 | import com.xiaoyuan.common.pojo.SysRole; 6 | import com.xiaoyuan.common.param.role.DeleteRoleParam; 7 | import com.xiaoyuan.common.param.role.InsertRoleParam; 8 | import com.xiaoyuan.common.param.role.PermissionRoleParam; 9 | import com.xiaoyuan.common.param.role.RoleQueryParam; 10 | import com.xiaoyuan.common.vo.R; 11 | import com.xiaoyuan.common.vo.SysRoleVo; 12 | 13 | import java.util.List; 14 | 15 | public interface SysRoleService extends IService { 16 | 17 | R>> listRolePage(RoleQueryParam queryParam); 18 | 19 | R updatePermission(PermissionRoleParam permissionRoleParam); 20 | 21 | /** 22 | * 新加角色 23 | */ 24 | R insertRole(InsertRoleParam insertRoleParam); 25 | 26 | /** 27 | * 删除角色 28 | */ 29 | R deleteRoleById(DeleteRoleParam deleteRoleParam); 30 | } 31 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/service/TimeLineService.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.xiaoyuan.common.pojo.TimeLine; 5 | import com.xiaoyuan.common.vo.TimeLineVo; 6 | import com.xiaoyuan.common.vo.R; 7 | 8 | /** 9 | * FileName: TimeLineService 10 | * Author: 小袁 11 | * Date: 2022/4/20 12:27 12 | * Description: 13 | */ 14 | public interface TimeLineService extends IService { 15 | 16 | /** 17 | * 添加一条时间线 18 | * @param timeLineVo 19 | * @return 20 | */ 21 | R insert(TimeLineVo timeLineVo); 22 | 23 | /** 24 | * 编辑时间线 25 | * @param timeLineVo 26 | * @return 27 | */ 28 | R modify(TimeLineVo timeLineVo); 29 | 30 | /** 31 | * 删除时间线 32 | * @param id 33 | * @return 34 | */ 35 | R delete(Long id); 36 | 37 | /** 38 | * 分页查询 39 | * @return 40 | */ 41 | R listTimeLinePage(Integer pageIndex, Integer pageSize); 42 | 43 | /** 44 | * 通过ID查询时间线 45 | * @param id 46 | * @return 47 | */ 48 | R getTimeLineInfoById(Long id); 49 | } 50 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/service/UserOperationService.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.xiaoyuan.common.pojo.UserOperation; 5 | import com.xiaoyuan.common.param.UserOperationParam; 6 | import com.xiaoyuan.common.vo.R; 7 | 8 | /** 9 | * FileName: UserOperationService 10 | * Author: 小袁教程 11 | * Date: 2022/6/7 12:13 12 | * Description: 13 | */ 14 | public interface UserOperationService extends IService { 15 | 16 | R selectOperationList(UserOperationParam operationParam); 17 | 18 | R selectOperationType(); 19 | } 20 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/service/impl/ArticleCategoryServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.service.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.xiaoyuan.back.mapper.ArticleCategoryMapper; 5 | import com.xiaoyuan.back.service.ArticleCategoryService; 6 | import com.xiaoyuan.common.pojo.ArticleCategory; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * FileName: ArticleCategoryServiceImpl 12 | * Author: 小袁 13 | * Date: 2022/4/16 18:11 14 | * Description: 15 | */ 16 | @Service 17 | @Transactional 18 | public class ArticleCategoryServiceImpl extends ServiceImpl implements ArticleCategoryService { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/task/ArticleTask.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.task; 2 | 3 | import cn.hutool.json.JSONUtil; 4 | import com.xiaoyuan.back.service.ArticleService; 5 | import com.xiaoyuan.common.param.ArticleParam; 6 | import lombok.extern.slf4j.Slf4j; 7 | 8 | import java.util.TimerTask; 9 | 10 | /** 11 | * @Author: YDW 12 | * @Date: 2023-05-12 09:54 13 | */ 14 | @Slf4j 15 | public class ArticleTask extends TimerTask { 16 | 17 | private final ArticleService articleService; 18 | 19 | private final ArticleParam articleParam; 20 | 21 | private final Long authorId; 22 | 23 | public ArticleTask(ArticleService articleService, ArticleParam articleParam, Long authorId) { 24 | this.articleService = articleService; 25 | this.articleParam = articleParam; 26 | this.authorId = authorId; 27 | } 28 | 29 | @Override 30 | public void run() { 31 | log.info("开始发布文章..."); 32 | log.info("参数:{}", JSONUtil.toJsonStr(articleParam)); 33 | int res = articleService.schedulePublish(articleParam, authorId); 34 | if (res != 1) { 35 | log.error("文章定时发布失败"); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /service-back/src/main/java/com/xiaoyuan/back/task/TaskProcessor.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.back.task; 2 | 3 | import cn.dev33.satoken.stp.StpUtil; 4 | import cn.hutool.core.date.DateUnit; 5 | import cn.hutool.core.date.DateUtil; 6 | import cn.hutool.extra.spring.SpringUtil; 7 | import com.xiaoyuan.back.service.ArticleService; 8 | import com.xiaoyuan.common.param.ArticleParam; 9 | import org.springframework.stereotype.Component; 10 | 11 | import java.util.Date; 12 | import java.util.concurrent.Executors; 13 | import java.util.concurrent.ScheduledExecutorService; 14 | import java.util.concurrent.TimeUnit; 15 | 16 | /** 17 | * 任务处理器 18 | * 19 | * @Author: YDW 20 | * @Date: 2023-05-12 09:52 21 | */ 22 | @Component 23 | public class TaskProcessor { 24 | 25 | private final ScheduledExecutorService executorService = Executors.newScheduledThreadPool(10); 26 | 27 | public void startArticleTask(String time, ArticleParam articleParam) { 28 | long delay = DateUtil.between(DateUtil.parse(time), new Date(), DateUnit.MINUTE); 29 | executorService.schedule(new ArticleTask(SpringUtil.getBean(ArticleService.class), articleParam, StpUtil.getLoginIdAsLong()), delay, TimeUnit.MILLISECONDS); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /service-back/src/main/resources/application-email.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | mail: 3 | host: smtp.qq.com 4 | username: QQ邮箱 5 | password: 密钥 6 | protocol: smtp 7 | default-encoding: UTF-8 8 | properties: 9 | mail: 10 | smtp: 11 | auth: true 12 | starttls: 13 | enable: true 14 | required: true 15 | ssl: 16 | enable: true 17 | -------------------------------------------------------------------------------- /service-back/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 9004 3 | servlet: 4 | context-path: "/back/api" 5 | spring: 6 | profiles: 7 | active: @profile.active@ 8 | include: email 9 | jackson: 10 | time-zone: GMT+8 11 | date-format: yyyy-MM-dd HH:mm:ss 12 | application: 13 | name: backServer 14 | servlet: 15 | multipart: 16 | max-file-size: 10MB 17 | max-request-size: 10MB 18 | # Sa-Token配置 19 | sa-token: 20 | # token 名称 (同时也是cookie名称) 21 | token-name: token 22 | # token 有效期,单位s 默认30天, -1代表永不过期 23 | timeout: 2592000 24 | # token 临时有效期 (指定时间内无操作就视为token过期) 单位: 秒 25 | activity-timeout: -1 26 | # 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录) 27 | is-concurrent: false 28 | # 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token) 29 | is-share: true 30 | # token风格 31 | token-style: uid 32 | # 是否输出操作日志 33 | is-log: false 34 | 35 | ########################## mybatis ########################## 36 | mybatis-plus: 37 | mapper-locations: classpath*:mapper/*.xml 38 | configuration: 39 | map-underscore-to-camel-case: true 40 | # 打印SQL语句 41 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl 42 | type-aliases-package: com.xiaoyuan.common.entity 43 | 44 | -------------------------------------------------------------------------------- /service-back/src/main/resources/mapper/ArticleCategoryMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /service-back/src/main/resources/mapper/ArticleCollectMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | delete from xy_article_collect 6 | where article_id = #{articleId} 7 | 8 | 9 | -------------------------------------------------------------------------------- /service-back/src/main/resources/mapper/ArticleCommentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | delete from xy_article_comment 7 | where article_id = #{articleId} 8 | 9 | 10 | -------------------------------------------------------------------------------- /service-back/src/main/resources/mapper/ArticleContentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /service-back/src/main/resources/mapper/ArticleLikeMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | delete from xy_article_like 6 | where article_id = #{articleId} 7 | 8 | 9 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/FrontApplication.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.ComponentScan; 8 | import org.springframework.web.client.RestTemplate; 9 | 10 | /** 11 | * FileName: FrontApplication 12 | * Author: 小袁 13 | * Date: 2022/4/23 22:30 14 | * Description: 15 | */ 16 | @SpringBootApplication 17 | @MapperScan(basePackages = {"com.xiaoyuan.front.mapper"}) 18 | @ComponentScan({"com.xiaoyuan"}) 19 | public class FrontApplication { 20 | 21 | public static void main(String[] args) { 22 | SpringApplication.run(FrontApplication.class, args); 23 | System.out.println("========================== 小袁博客前台服务启动成功 =========================="); 24 | } 25 | 26 | @Bean 27 | public RestTemplate getRestTemplate() { 28 | return new RestTemplate(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/annotation/AddressRequestLimit.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.annotation; 2 | 3 | import java.lang.annotation.*; 4 | 5 | /** 6 | * FileName: AddressRequestLimit 7 | * Author: 小袁 8 | * Date: 2022/4/29 22:45 9 | * Description: 限制IP请求上限 10 | */ 11 | @Target({ElementType.METHOD, ElementType.TYPE}) 12 | @Retention(RetentionPolicy.RUNTIME) 13 | @Documented 14 | public @interface AddressRequestLimit { 15 | 16 | long seconds() default 6000; // 限制时间 单位:ms 17 | int maxCount() default 5; // 限制请求上限 18 | } 19 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/annotation/CookieOperation.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.annotation; 2 | 3 | 4 | import java.lang.annotation.*; 5 | 6 | /** 7 | * FileName: WriteCookieToken 8 | * Author: 小袁 9 | * Date: 2022/5/3 16:57 10 | * Description: 11 | */ 12 | @Target(ElementType.METHOD) 13 | @Retention(RetentionPolicy.RUNTIME) 14 | @Documented 15 | public @interface CookieOperation { 16 | 17 | boolean userToken() default false; 18 | 19 | boolean delUserToken() default false; 20 | 21 | boolean phonePermission() default false; 22 | 23 | boolean emailPermission() default false; 24 | } 25 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/config/CorsConfig.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 6 | 7 | @Configuration 8 | public class CorsConfig implements WebMvcConfigurer{ 9 | @Override 10 | public void addCorsMappings(CorsRegistry registry) { 11 | registry.addMapping("/**") 12 | .allowedOrigins("*") 13 | .allowedMethods("POST", "GET", "PUT", "OPTIONS", "DELETE") 14 | .maxAge(3600) 15 | .allowCredentials(true); 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/config/MyBatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.config; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; 4 | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | /** 9 | * FileName: MyBatisPlusConfig 10 | * Author: 小袁 11 | * Date: 2022/1/23 11:22 12 | * Description: 分页配置 13 | */ 14 | @Configuration 15 | public class MyBatisPlusConfig { 16 | 17 | /* 分页插件 */ 18 | @Bean 19 | public MybatisPlusInterceptor mybatisPlusInterceptor() { 20 | MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); 21 | // 开启 22 | interceptor.addInnerInterceptor(new PaginationInnerInterceptor()); 23 | return interceptor; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/config/XssFilter.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.config; 2 | 3 | import javax.servlet.*; 4 | import javax.servlet.annotation.WebFilter; 5 | import javax.servlet.http.HttpServletRequest; 6 | import java.io.IOException; 7 | 8 | @WebFilter(urlPatterns = "/*") 9 | public class XssFilter implements Filter { 10 | 11 | public void init(FilterConfig config) throws ServletException { 12 | } 13 | 14 | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) 15 | throws IOException, ServletException { 16 | XssHttpServletRequestWrapper xssRequest = new XssHttpServletRequestWrapper( 17 | (HttpServletRequest) request); 18 | chain.doFilter(xssRequest, response); 19 | } 20 | 21 | @Override 22 | public void destroy() { 23 | } 24 | } -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/mapper/ArticleCollectMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.ArticleCollect; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * FileName: ArticleCollectMapper 9 | * Author: 小袁 10 | * Date: 2022/5/11 9:27 11 | * Description: 12 | */ 13 | @Repository 14 | public interface ArticleCollectMapper extends BaseMapper { 15 | 16 | int removeCollect(long articleId, long userId); 17 | 18 | int findCountByArticleId(long articleId); 19 | 20 | boolean isContainCollect(long articleId, long userId); 21 | } 22 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/mapper/ArticleCommentMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.ArticleComment; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * FileName: ArticleCommentMapper 9 | * Author: 小袁 10 | * Date: 2022/5/3 19:30 11 | * Description: 12 | */ 13 | @Repository 14 | public interface ArticleCommentMapper extends BaseMapper { 15 | 16 | int findCountByArticle(long articleId); 17 | } 18 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/mapper/ArticleContentMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.ArticleContent; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * FileName: ArticleContentMapper 9 | * Author: 小袁 10 | * Date: 2022/4/16 18:35 11 | * Description: 12 | */ 13 | @Repository 14 | public interface ArticleContentMapper extends BaseMapper { 15 | 16 | /** 17 | * 根据文章编号获取Markdown文本 18 | * @param id 19 | * @return 20 | */ 21 | String getArticleMarkdownById(String id); 22 | } 23 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/mapper/ArticleLikeMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.ArticleLike; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * FileName: ArticleLikeMapper 9 | * Author: 小袁 10 | * Date: 2022/5/11 9:28 11 | * Description: 12 | */ 13 | @Repository 14 | public interface ArticleLikeMapper extends BaseMapper { 15 | 16 | int removeLike(long articleId, long userId); 17 | 18 | int findCountByArticleId(long articleId); 19 | 20 | boolean isContainLike(long articleId, long userId); 21 | } 22 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/mapper/CategoryMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.front.vo.CategoryVo; 5 | import com.xiaoyuan.common.pojo.Category; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * FileName: CategoryMapper 12 | * Author: 小袁 13 | * Date: 2022/4/15 10:52 14 | * Description: 分类DAO 15 | */ 16 | @Repository 17 | public interface CategoryMapper extends BaseMapper { 18 | 19 | /** 20 | * 查询所有分类的目录结构 21 | * @return 22 | */ 23 | List findCategoryList(); 24 | 25 | /** 26 | * 查询文章的分类 27 | * @param articleId 28 | * @return 29 | */ 30 | List findArticleCategory(long articleId); 31 | } 32 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/mapper/FriendLinkMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.FriendLink; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * FileName: FriendLinkMapper 9 | * Author: 小袁 10 | * Date: 2022/4/30 15:05 11 | * Description: 12 | */ 13 | @Repository 14 | public interface FriendLinkMapper extends BaseMapper { 15 | } 16 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/mapper/FrontLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.FrontLog; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * FileName: FrontLogMapper 9 | * Author: 小袁教程 10 | * Date: 2022/5/17 16:32 11 | * Description: 12 | */ 13 | @Repository 14 | public interface FrontLogMapper extends BaseMapper { 15 | } 16 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/mapper/HomeMessageMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.HomeMessage; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * FileName: HomeMessageMapper 9 | * Author: 小袁 10 | * Date: 2022/4/27 20:17 11 | * Description: 12 | */ 13 | @Repository 14 | public interface HomeMessageMapper extends BaseMapper { 15 | 16 | /** 17 | * 查询留言总数 18 | * @return 19 | */ 20 | int findTotal(); 21 | } 22 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/mapper/ProblemFeedbackMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.ProblemFeedback; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * FileName: ProblemFeedbackMapper 9 | * Author: 小袁 10 | * Date: 2022/4/21 8:46 11 | * Description: 12 | */ 13 | @Repository 14 | public interface ProblemFeedbackMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/mapper/SuggestFeedbackMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.SuggestFeedback; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * FileName: SuggestFeedbackMapper 9 | * Author: 小袁 10 | * Date: 2022/4/28 19:11 11 | * Description: 12 | */ 13 | @Repository 14 | public interface SuggestFeedbackMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/mapper/TimeLineMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.TimeLine; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * FileName: TimeLineMapper 9 | * Author: 小袁 10 | * Date: 2022/4/20 12:27 11 | * Description: 12 | */ 13 | @Repository 14 | public interface TimeLineMapper extends BaseMapper { 15 | } 16 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/mapper/UserOperationMapper.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xiaoyuan.common.pojo.UserOperation; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * FileName: UserOperationMapper 9 | * Author: 小袁教程 10 | * Date: 2022/5/17 15:47 11 | * Description: 12 | */ 13 | @Repository 14 | public interface UserOperationMapper extends BaseMapper { 15 | } 16 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/service/ArticleCollectService.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.xiaoyuan.common.pojo.ArticleCollect; 5 | import com.xiaoyuan.common.param.article.ArticleLikeParam; 6 | import com.xiaoyuan.common.vo.R; 7 | 8 | /** 9 | * FileName: ArticleCollectService 10 | * Author: 小袁 11 | * Date: 2022/5/11 9:28 12 | * Description: 13 | */ 14 | public interface ArticleCollectService extends IService { 15 | 16 | /** 17 | * 收藏 18 | */ 19 | R collectArticle(ArticleLikeParam articleLikeParam); 20 | 21 | R getCollectInfo(String token, ArticleLikeParam articleLikeParam); 22 | } 23 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/service/ArticleCommentService.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.xiaoyuan.front.vo.param.ArticleCommentParam; 5 | import com.xiaoyuan.common.pojo.ArticleComment; 6 | import com.xiaoyuan.common.param.article.ArticleLikeParam; 7 | import com.xiaoyuan.common.param.article.CommentDeleteParam; 8 | import com.xiaoyuan.common.vo.R; 9 | 10 | /** 11 | * FileName: ArticleCommentService 12 | * Author: 小袁 13 | * Date: 2022/5/3 19:30 14 | * Description: 15 | */ 16 | public interface ArticleCommentService extends IService { 17 | 18 | /** 19 | * 插入一条评论 20 | */ 21 | R insert(ArticleCommentParam articleCommentParam); 22 | 23 | /** 24 | * 删除评论 25 | */ 26 | R delete(String token, CommentDeleteParam commentDeleteParam); 27 | 28 | /** 29 | * 修改评论内容 30 | */ 31 | R modify(String token, ArticleCommentParam articleCommentParam); 32 | 33 | /** 34 | * 查询文章评论 35 | */ 36 | R listCommentPage(String token, ArticleLikeParam articleLikeParam); 37 | } 38 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/service/ArticleLikeService.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.xiaoyuan.common.pojo.ArticleLike; 5 | import com.xiaoyuan.common.param.article.ArticleLikeParam; 6 | import com.xiaoyuan.common.vo.R; 7 | 8 | /** 9 | * FileName: ArticleLikeService 10 | * Author: 小袁 11 | * Date: 2022/5/11 9:29 12 | * Description: 13 | */ 14 | public interface ArticleLikeService extends IService { 15 | 16 | /** 17 | * 点赞文章 18 | */ 19 | R likeArticle(ArticleLikeParam articleLikeParam); 20 | 21 | /** 22 | * 获取文章点赞信息 23 | */ 24 | R getLikeInfo(String token, ArticleLikeParam articleLikeParam); 25 | } 26 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/service/CategoryService.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.xiaoyuan.common.pojo.Category; 5 | import com.xiaoyuan.common.vo.R; 6 | 7 | /** 8 | * FileName: CategoryService 9 | * Author: 小袁 10 | * Date: 2022/5/5 9:19 11 | * Description: 12 | */ 13 | public interface CategoryService extends IService { 14 | 15 | /** 16 | * 查询所有分类的目录结构 17 | * @return 18 | */ 19 | R listCategory(); 20 | } 21 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/service/FriendLinkService.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.xiaoyuan.common.pojo.FriendLink; 5 | import com.xiaoyuan.common.vo.R; 6 | 7 | /** 8 | * FileName: FriendLinkService 9 | * Author: 小袁 10 | * Date: 2022/4/30 15:10 11 | * Description: 12 | */ 13 | public interface FriendLinkService extends IService { 14 | 15 | /** 16 | * 查询所有友链 17 | * @return 18 | */ 19 | R findFriendLinkAll(); 20 | } 21 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/service/HomeMessageService.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.xiaoyuan.front.vo.param.HomeMessageParam; 5 | import com.xiaoyuan.common.pojo.HomeMessage; 6 | import com.xiaoyuan.common.vo.PageUtils; 7 | import com.xiaoyuan.common.vo.R; 8 | 9 | /** 10 | * FileName: HomeMessageService 11 | * Author: 小袁 12 | * Date: 2022/4/27 20:16 13 | * Description: 14 | */ 15 | public interface HomeMessageService extends IService { 16 | 17 | /** 18 | * 插入一条留言 19 | * @param homeMessageParam 20 | * @return 21 | */ 22 | R insert(HomeMessageParam homeMessageParam); 23 | 24 | /** 25 | * 查询首页留言 26 | * @param pageUtils 分页对象 27 | * @return 28 | */ 29 | R listHomeMessagePage(PageUtils pageUtils); 30 | 31 | /** 32 | * 查询留言总数 33 | * @return 34 | */ 35 | Integer findMessageTotal(); 36 | } 37 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/service/MailService.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.service; 2 | 3 | import javax.mail.MessagingException; 4 | import java.io.UnsupportedEncodingException; 5 | 6 | public interface MailService { 7 | 8 | /** 9 | * 发送简单的邮箱 10 | * 11 | * @param to 收件人 12 | * @param theme 标题 13 | * @param content 正文内容 14 | * @param cc 抄送 15 | */ 16 | void sendSampleMail(String to, String theme, String content, String... cc) throws UnsupportedEncodingException; 17 | 18 | /** 19 | * 发送HTML邮件 20 | * 21 | * @param to 收件人地址 22 | * @param subject 邮件主题 23 | * @param content 邮件内容 24 | * @param cc 抄送地址 25 | * @throws MessagingException 邮件发送异常 26 | */ 27 | void sendHtmlMail(String to, String subject, String content, String... cc) throws MessagingException; 28 | } 29 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/service/ProblemFeedbackService.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.xiaoyuan.front.vo.param.ProblemFeedbackParam; 5 | import com.xiaoyuan.common.pojo.ProblemFeedback; 6 | import com.xiaoyuan.common.vo.R; 7 | 8 | /** 9 | * FileName: ProblemFeedbackService 10 | * Author: 小袁 11 | * Date: 2022/4/25 13:18 12 | * Description: 13 | */ 14 | public interface ProblemFeedbackService extends IService { 15 | 16 | /** 17 | * 插入一条问题反馈数据 18 | * @param problemFeedbackParam 19 | * @return 20 | */ 21 | R insert(ProblemFeedbackParam problemFeedbackParam); 22 | } 23 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/service/SuggestFeedbackService.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.xiaoyuan.common.pojo.SuggestFeedback; 5 | import com.xiaoyuan.common.vo.R; 6 | 7 | /** 8 | * FileName: SuggestFeedbackService 9 | * Author: 小袁 10 | * Date: 2022/4/28 19:11 11 | * Description: 12 | */ 13 | public interface SuggestFeedbackService extends IService { 14 | 15 | /** 16 | * 提交建议 17 | * @param suggestFeedback 18 | * @return 19 | */ 20 | R insert(SuggestFeedback suggestFeedback); 21 | } 22 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/service/TimeLineService.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.xiaoyuan.common.pojo.TimeLine; 5 | import com.xiaoyuan.common.vo.PageUtils; 6 | import com.xiaoyuan.common.vo.R; 7 | 8 | /** 9 | * FileName: TimeLineService 10 | * Author: 小袁 11 | * Date: 2022/4/23 23:38 12 | * Description: 13 | */ 14 | public interface TimeLineService extends IService { 15 | 16 | /** 17 | * 查询时间线 18 | * @param pageUtils 19 | * @return 20 | */ 21 | R findTimeLineList(PageUtils pageUtils); 22 | } 23 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/service/TokenService.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.service; 2 | 3 | import com.xiaoyuan.front.vo.CommonUserVo; 4 | 5 | /** 6 | * FileName: TokenService 7 | * Author: 小袁 8 | * Date: 2022/5/3 9:51 9 | * Description: 10 | */ 11 | public interface TokenService { 12 | 13 | /** 14 | * 检查token合法性 15 | */ 16 | CommonUserVo checkToken(String token); 17 | } 18 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/service/impl/CategoryServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.service.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.xiaoyuan.front.mapper.CategoryMapper; 5 | import com.xiaoyuan.front.service.CategoryService; 6 | import com.xiaoyuan.common.pojo.Category; 7 | import com.xiaoyuan.common.vo.R; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Repository; 10 | 11 | import java.util.HashMap; 12 | import java.util.Map; 13 | 14 | /** 15 | * FileName: CategoryServiceImpl 16 | * Author: 小袁 17 | * Date: 2022/5/5 9:19 18 | * Description: 19 | */ 20 | @Repository 21 | public class CategoryServiceImpl extends ServiceImpl implements CategoryService { 22 | 23 | @Autowired 24 | private CategoryMapper categoryMapper; 25 | 26 | @Override 27 | public R listCategory() { 28 | Map map = new HashMap<>(); 29 | map.put("categoryList", categoryMapper.findCategoryList()); 30 | 31 | return R.success(map); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/service/impl/FriendLinkServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.service.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.xiaoyuan.front.mapper.FriendLinkMapper; 5 | import com.xiaoyuan.front.service.FriendLinkService; 6 | import com.xiaoyuan.common.pojo.FriendLink; 7 | import com.xiaoyuan.common.vo.R; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.util.HashMap; 11 | import java.util.Map; 12 | 13 | /** 14 | * FileName: FriendLinkServiceImpl 15 | * Author: 小袁 16 | * Date: 2022/4/30 15:10 17 | * Description: 18 | */ 19 | @Service 20 | public class FriendLinkServiceImpl extends ServiceImpl implements FriendLinkService { 21 | 22 | @Override 23 | public R findFriendLinkAll() { 24 | Map map = new HashMap<>(); 25 | map.put("friendLinkList", this.baseMapper.selectList(null)); 26 | 27 | return R.success(map); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/utils/StringThreadLocal.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.utils; 2 | 3 | /** 4 | * FileName: StringThreadLocal 5 | * Author: 小袁 6 | * Date: 2022/5/3 15:10 7 | * Description: 8 | */ 9 | public class StringThreadLocal { 10 | 11 | private StringThreadLocal() {} 12 | 13 | private static final ThreadLocal LOCAL = new ThreadLocal<>(); 14 | 15 | public static void put(String s) { 16 | LOCAL.set(s); 17 | } 18 | 19 | public static String get() { 20 | return LOCAL.get(); 21 | } 22 | 23 | public static void remove() { 24 | LOCAL.remove(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/utils/UserThreadLocal.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.utils; 2 | 3 | import com.xiaoyuan.front.vo.CommonUserVo; 4 | 5 | /** 6 | * FileName: UserThreadLocal 7 | * Author: 小袁 8 | * Date: 2022/5/3 9:26 9 | * Description: 10 | */ 11 | public class UserThreadLocal { 12 | 13 | // 构造私有化 14 | private UserThreadLocal() {} 15 | 16 | private static final ThreadLocal LOCAL = new ThreadLocal<>(); 17 | 18 | public static void put(CommonUserVo commonUserVo) { 19 | LOCAL.set(commonUserVo); 20 | } 21 | 22 | public static CommonUserVo get() { 23 | return LOCAL.get(); 24 | } 25 | 26 | public static void remove() { 27 | LOCAL.remove(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/vo/ArchivesVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.vo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonInclude; 4 | import com.xiaoyuan.common.vo.article.ArticleVo; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * FileName: ArchiveVo 11 | * Author: 小袁 12 | * Date: 2022/4/24 20:32 13 | * Description: 14 | */ 15 | @Data 16 | @JsonInclude(JsonInclude.Include.NON_NULL) 17 | public class ArchivesVo { 18 | 19 | // 档案时间 20 | private String archivesTime; 21 | 22 | // 档案数 23 | private Integer count; 24 | 25 | // 文章列表 26 | private List articleList; 27 | } 28 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/vo/CategoryVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * FileName: CategoryVo 9 | * Author: 小袁 10 | * Date: 2022/5/10 19:12 11 | * Description: 12 | */ 13 | @Data 14 | public class CategoryVo { 15 | 16 | /** 17 | * 分类编号 18 | */ 19 | private Integer id; 20 | 21 | /** 22 | * 分类名称 23 | */ 24 | private String name; 25 | 26 | /** 27 | * 文章总数 28 | */ 29 | private int count; 30 | 31 | /** 32 | * 子分类 33 | */ 34 | private List children; 35 | } 36 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/vo/CommonUserVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * FileName: CommonUserVo 9 | * Author: 小袁 10 | * Date: 2022/5/2 19:50 11 | * Description: 12 | */ 13 | @Data 14 | public class CommonUserVo implements Serializable { 15 | 16 | private static final long serialVersionUID = 1L; 17 | 18 | // 用户编号 19 | private String number; 20 | 21 | private String comUserCode; 22 | 23 | // 用户名 24 | private String username; 25 | 26 | // 昵称 27 | private String nickname; 28 | 29 | // 邮箱 30 | private String email; 31 | 32 | // 手机号码 33 | private String mobileNumber; 34 | 35 | // 头像 36 | private String avatar; 37 | } 38 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/vo/HomeMessageVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.vo; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * FileName: HomeMessageVo 7 | * Author: 小袁 8 | * Date: 2022/4/27 20:34 9 | * Description: 10 | */ 11 | @Data 12 | public class HomeMessageVo { 13 | 14 | private String content; 15 | 16 | private String detailContent; 17 | 18 | private String background; 19 | 20 | private String gmtCreate; 21 | } 22 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/vo/param/ArticleCommentParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.vo.param; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * FileName: ArticleCommentParam 7 | * Author: 小袁 8 | * Date: 2022/5/3 19:31 9 | * Description: 10 | */ 11 | @Data 12 | public class ArticleCommentParam { 13 | 14 | // 标题 15 | private String title; 16 | 17 | // 评论编号 18 | private String number; 19 | 20 | // 文章编号 21 | private String articleNumber; 22 | 23 | // 评论内容 24 | private String content; 25 | } 26 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/vo/param/CodeParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.vo.param; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * FileName: CodeParam 7 | * Author: 小袁 8 | * Date: 2022/5/9 0:41 9 | * Description: 10 | */ 11 | @Data 12 | public class CodeParam { 13 | 14 | private String email; 15 | 16 | private String mobileNumber; 17 | 18 | private String code; 19 | } 20 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/vo/param/ConditionParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.vo.param; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * FileName: ConditionParam 7 | * Author: 小袁 8 | * Date: 2022/4/26 20:42 9 | * Description: 10 | */ 11 | @Data 12 | public class ConditionParam { 13 | 14 | private String condition; 15 | } 16 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/vo/param/HomeMessageParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.vo.param; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * FileName: HomeMessageParam 7 | * Author: 小袁 8 | * Date: 2022/4/27 20:34 9 | * Description: 10 | */ 11 | @Data 12 | public class HomeMessageParam { 13 | 14 | private String authorId; 15 | 16 | private String content; 17 | 18 | private String detailContent; 19 | } 20 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/vo/param/MailParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.vo.param; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * FileName: MailParam 7 | * Author: 小袁 8 | * Date: 2022/5/2 19:06 9 | * Description: 10 | */ 11 | @Data 12 | public class MailParam { 13 | 14 | // 收件人 15 | private String mail; 16 | 17 | // 验证码 18 | private String code; 19 | } 20 | -------------------------------------------------------------------------------- /service-front/src/main/java/com/xiaoyuan/front/vo/param/ProblemFeedbackParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front.vo.param; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * FileName: ProblemFeedbackParam 7 | * Author: 小袁 8 | * Date: 2022/4/25 13:15 9 | * Description: 10 | */ 11 | @Data 12 | public class ProblemFeedbackParam { 13 | 14 | /** 15 | * 邮箱 16 | */ 17 | private String email; 18 | 19 | /** 20 | * 问题内容 21 | */ 22 | private String problem; 23 | } 24 | -------------------------------------------------------------------------------- /service-front/src/main/resources/application-dev.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | ########################## druid配置 ########################## 3 | datasource: 4 | type: com.alibaba.druid.pool.DruidDataSource 5 | druid: 6 | driver-class-name: com.mysql.cj.jdbc.Driver 7 | url: jdbc:mysql:///xiaoyuanboke?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8 8 | username: root 9 | password: root123 10 | # 初始化大小,最小,最大 11 | initial-size: 5 12 | min-idle: 5 13 | max-active: 20 14 | # 配置获取连接等待超时的时间 15 | max-wait: 60000 16 | # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 17 | time-between-eviction-runs-millis: 60000 18 | # 配置一个连接在池中最小生存的时间,单位是毫秒 19 | min-evictable-idle-time-millis: 300000 20 | validation-query: SELECT 'x' 21 | test-while-idle: false 22 | test-on-borrow: false 23 | test-on-return: false 24 | redis: 25 | port: 6379 26 | host: localhost 27 | 28 | logging: 29 | level: 30 | com.shyroke.mapper: debug 31 | -------------------------------------------------------------------------------- /service-front/src/main/resources/application-email.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | mail: 3 | host: smtp.qq.com 4 | username: 1971788445@qq.com 5 | password: 密钥 6 | protocol: smtp 7 | default-encoding: UTF-8 8 | properties: 9 | mail: 10 | smtp: 11 | auth: true 12 | starttls: 13 | enable: true 14 | required: true 15 | ssl: 16 | enable: true 17 | -------------------------------------------------------------------------------- /service-front/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 9003 3 | spring: 4 | profiles: 5 | active: @profile.active@ 6 | include: email 7 | application: 8 | name: frontServer 9 | mvc: 10 | static-path-pattern: /static/** 11 | mybatis-plus: 12 | mapper-locations: classpath*:mapper/*.xml 13 | # configuration: 14 | # # 打印SQL语句 15 | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl 16 | global-config: 17 | db-config: 18 | table-prefix: xy_ 19 | type-aliases-package: com.xiaoyuan.common.entity 20 | -------------------------------------------------------------------------------- /service-front/src/main/resources/mapper/ArticleCollectMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | 11 | 12 | 17 | 18 | 19 | 24 | 25 | -------------------------------------------------------------------------------- /service-front/src/main/resources/mapper/ArticleCommentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /service-front/src/main/resources/mapper/ArticleContentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /service-front/src/main/resources/mapper/ArticleLikeMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | delete from xy_article_like 14 | where user_id = #{userId} AND article_id = #{articleId} 15 | 16 | 17 | 18 | 23 | 24 | -------------------------------------------------------------------------------- /service-front/src/main/resources/mapper/FriendLinkMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /service-front/src/main/resources/mapper/HomeMessageMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /service-front/src/main/resources/mapper/TimeLineMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /service-front/src/main/resources/static/css/customer/example.css: -------------------------------------------------------------------------------- 1 | html, body, div, span, applet, object, iframe, 2 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 3 | a, abbr, acronym, address, big, cite, code, 4 | del, dfn, em, img, ins, kbd, q, s, samp, 5 | small, strike, strong, sub, sup, tt, var, 6 | b, u, i, center, 7 | dl, dt, dd, ol, ul, li, 8 | fieldset, form, label, legend, 9 | table, caption, tbody, tfoot, thead, tr, th, td, 10 | article, aside, canvas, details, embed, 11 | figure, figcaption, footer, header, hgroup, 12 | menu, nav, output, ruby, section, summary, 13 | time, mark, audio, video { 14 | margin: 0; 15 | padding: 0; 16 | border: 0; 17 | } 18 | html,body{ 19 | font-family: "微软雅黑"; 20 | position: relative; 21 | } 22 | body{ 23 | overflow-x: hidden; 24 | } 25 | li{ 26 | list-style: none; 27 | } -------------------------------------------------------------------------------- /service-front/src/main/resources/static/css/fonts/element-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/css/fonts/element-icons.ttf -------------------------------------------------------------------------------- /service-front/src/main/resources/static/css/fonts/element-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/css/fonts/element-icons.woff -------------------------------------------------------------------------------- /service-front/src/main/resources/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /service-front/src/main/resources/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /service-front/src/main/resources/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /service-front/src/main/resources/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /service-front/src/main/resources/static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /service-front/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /service-front/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /service-front/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /service-front/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /service-front/src/main/resources/static/fonts/player/icon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/fonts/player/icon.eot -------------------------------------------------------------------------------- /service-front/src/main/resources/static/fonts/player/icon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/fonts/player/icon.ttf -------------------------------------------------------------------------------- /service-front/src/main/resources/static/fonts/player/icon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/fonts/player/icon.woff -------------------------------------------------------------------------------- /service-front/src/main/resources/static/fonts/xy-iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/fonts/xy-iconfont.ttf -------------------------------------------------------------------------------- /service-front/src/main/resources/static/fonts/xy-iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/fonts/xy-iconfont.woff -------------------------------------------------------------------------------- /service-front/src/main/resources/static/fonts/xy-iconfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/fonts/xy-iconfont.woff2 -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/appreciate.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/appreciate.jpg -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/appreciate1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/appreciate1.jpg -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/b.jpg -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/bg.jpg -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/bg/TimeLine.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/bg/TimeLine.jpg -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/bg/aboutme_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/bg/aboutme_bg.jpg -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/bg/archive_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/bg/archive_bg.jpg -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/bg/classify_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/bg/classify_bg.jpg -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/bg/friendlink_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/bg/friendlink_bg.jpg -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/bg/home.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/bg/home.jpg -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/bg/login-form_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/bg/login-form_bg.jpg -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/bg/login_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/bg/login_bg.jpg -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/bg/message.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/bg/message.jpg -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/bg/story_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/bg/story_bg.jpg -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/bg/xinhua_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/bg/xinhua_1.jpg -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/bg/xinhua_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/bg/xinhua_2.jpg -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/bg/xinhua_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/bg/xinhua_4.jpg -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/bg/xinhua_5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/bg/xinhua_5.jpg -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/favicon.ico -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/home_background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/home_background.jpg -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/icon/collectActive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/icon/collectActive.png -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/icon/collectNoActive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/icon/collectNoActive.png -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/icon/commentNoActive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/icon/commentNoActive.png -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/icon/likeActive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/icon/likeActive.png -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/icon/likeNoActive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/icon/likeNoActive.png -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/logo.png -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/pic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/pic.png -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/qq_group.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/qq_group.jpg -------------------------------------------------------------------------------- /service-front/src/main/resources/static/img/social_icon_24x24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/img/social_icon_24x24.png -------------------------------------------------------------------------------- /service-front/src/main/resources/static/js/api/articleComment.js: -------------------------------------------------------------------------------- 1 | import request from '../utils/request.js' 2 | 3 | export default { 4 | 5 | /** 6 | * 添加一条评论 7 | * @param commentParam 8 | * @returns {*} 9 | */ 10 | addComment(commentParam) { 11 | return request({ 12 | url: '/article/comment', 13 | method: 'post', 14 | data: commentParam 15 | }) 16 | }, 17 | 18 | /** 19 | * 删除一条评论 20 | * @param number 21 | * @returns {*} 22 | */ 23 | deleteComment(number){ 24 | return request({ 25 | url: '/article/comment', 26 | method: 'delete', 27 | data: { 28 | number 29 | } 30 | }) 31 | }, 32 | 33 | /** 34 | * 编辑一条评论 35 | * @param commentParam 36 | * @returns {*} 37 | */ 38 | editComment(commentParam) { 39 | return request({ 40 | url: '/article/comment', 41 | method: 'put', 42 | data: commentParam 43 | }) 44 | }, 45 | 46 | /** 47 | * 查询文章评论 48 | * @param param 49 | * @returns {*} 50 | */ 51 | findCommentList(param) { 52 | return request({ 53 | url: '/article/comment/list', 54 | method: 'post', 55 | data: param 56 | }) 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /service-front/src/main/resources/static/js/api/classify.js: -------------------------------------------------------------------------------- 1 | import request from '../utils/request.js' 2 | 3 | export default { 4 | findCategoryList() { 5 | return request({ 6 | url: '/classify/list', 7 | method: 'get', 8 | }) 9 | }, 10 | } -------------------------------------------------------------------------------- /service-front/src/main/resources/static/js/api/commonService.js: -------------------------------------------------------------------------------- 1 | import request from '../utils/request.js' 2 | 3 | export default { 4 | 5 | /** 6 | * 发送邮箱验证码 7 | * @param loginParam 8 | * @returns {*} 9 | */ 10 | sendEmailCode(email) { 11 | return request({ 12 | url: '/service/code/email', 13 | method: 'post', 14 | data: { 15 | 'email': email 16 | } 17 | }) 18 | }, 19 | 20 | /** 21 | * 发送短信验证码 22 | * @param phone 23 | * @returns {*} 24 | */ 25 | sendSmsCode(phone) { 26 | return request({ 27 | url: '/service/code/sms', 28 | method: 'post', 29 | data: { 30 | 'phone': phone 31 | } 32 | }) 33 | }, 34 | 35 | getSmsCodePermission(phone) { 36 | return request({ 37 | url: '/service/code/sms/request', 38 | method: 'post', 39 | data: { 40 | 'phone': phone 41 | } 42 | }) 43 | }, 44 | 45 | getEmailCodePermission(email) { 46 | return request({ 47 | url: '/service/code/email/request', 48 | method: 'post', 49 | data: { 50 | 'email': email 51 | } 52 | }) 53 | } 54 | } -------------------------------------------------------------------------------- /service-front/src/main/resources/static/js/api/feedback.js: -------------------------------------------------------------------------------- 1 | import request from '../utils/request.js' 2 | 3 | export default { 4 | 5 | /** 6 | * 提交问题反馈 7 | * @param problemParam 8 | * @returns {*} 9 | */ 10 | submitProblemFeedback(problemParam) { 11 | return request({ 12 | url: '/feedback/problem', 13 | method: 'post', 14 | data: problemParam 15 | }) 16 | }, 17 | 18 | /** 19 | * 提交建议反馈 20 | * @param suggestParam 21 | * @returns {*} 22 | */ 23 | submitSuggestFeedback(suggestParam) { 24 | return request({ 25 | url: '/feedback/suggest', 26 | method: 'post', 27 | data: suggestParam 28 | }) 29 | } 30 | } -------------------------------------------------------------------------------- /service-front/src/main/resources/static/js/api/friendlink.js: -------------------------------------------------------------------------------- 1 | import request from '../utils/request.js' 2 | 3 | export default { 4 | findFriendLinkAll() { 5 | return request({ 6 | url: '/friendlink/list', 7 | method: 'get' 8 | }) 9 | } 10 | } -------------------------------------------------------------------------------- /service-front/src/main/resources/static/js/api/message.js: -------------------------------------------------------------------------------- 1 | import request from '../utils/request.js' 2 | 3 | export default { 4 | 5 | /** 6 | * 查询留言列表 7 | * @param pageParam 8 | * @returns {*} 9 | */ 10 | findMessageList(pageParam) { 11 | return request({ 12 | url: '/homeMessage/list', 13 | method: 'post', 14 | data: pageParam 15 | }) 16 | }, 17 | 18 | /** 19 | * 添加留言 20 | * @param homeMessageParam 21 | * @returns {*} 22 | */ 23 | addMessage(homeMessageParam) { 24 | return request({ 25 | url: '/homeMessage/insert', 26 | method: 'post', 27 | data: homeMessageParam 28 | }) 29 | } 30 | } -------------------------------------------------------------------------------- /service-front/src/main/resources/static/js/api/timeline.js: -------------------------------------------------------------------------------- 1 | import request from "../utils/request.js"; 2 | 3 | export default { 4 | findTimeLineList() { 5 | let pageParam = {}; 6 | pageParam['pageIndex'] = 1; 7 | pageParam['pageSize'] = 10; 8 | return request({ 9 | url: '/timeline/list', 10 | method: 'post', 11 | data: pageParam 12 | }); 13 | } 14 | }; -------------------------------------------------------------------------------- /service-front/src/main/resources/static/js/test.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/js/test.js -------------------------------------------------------------------------------- /service-front/src/main/resources/static/js/utils/commonUtil.js: -------------------------------------------------------------------------------- 1 | export default { 2 | // 时间处理函数 3 | formatTime(time){ 4 | const d = new Date(time) 5 | const now = Date.now() 6 | 7 | const diff = (now - d) / 1000 8 | 9 | if (diff < 30) { 10 | return '刚刚' 11 | } else if (diff < 3600) { 12 | // less 1 hour 13 | return Math.ceil(diff / 60) + '分钟前' 14 | } else if (diff < 3600 * 24) { 15 | return Math.ceil(diff / 3600) + '小时前' 16 | } else if (diff < 3600 * 24 * 2) { 17 | return '1天前' 18 | } 19 | return time 20 | } 21 | } -------------------------------------------------------------------------------- /service-front/src/main/resources/static/js/utils/validator.js: -------------------------------------------------------------------------------- 1 | export default { 2 | 3 | /* 合法邮箱 */ 4 | validateEmail(email) { 5 | return /^([a-zA-Z0-9]+[-_\.]?)+@[a-zA-Z0-9]+\.[a-z]+$/.test(email) 6 | }, 7 | 8 | /* 合法号码 */ 9 | validatePhone(phone) { 10 | return /^[1][3,4,5,7,8][0-9]{9}$/.test(phone) 11 | }, 12 | 13 | /* 是否为空 */ 14 | isEmpty(obj){ 15 | return typeof obj == "undefined" || obj == null || obj === ""; 16 | } 17 | } -------------------------------------------------------------------------------- /service-front/src/main/resources/static/video/home_background.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/service-front/src/main/resources/static/video/home_background.mp4 -------------------------------------------------------------------------------- /service-front/src/test/java/com/xiaoyuan/front/FrontApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.front; 2 | 3 | import com.xiaoyuan.front.mapper.CommonUserMapper; 4 | import org.junit.jupiter.api.Test; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | 8 | @SpringBootTest 9 | public class FrontApplicationTest { 10 | 11 | @Autowired 12 | private CommonUserMapper commonUserMapper; 13 | 14 | @Test 15 | public void f() { 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "modules": false, 5 | "targets": { 6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] 7 | } 8 | }], 9 | "stage-2" 10 | ], 11 | "plugins":[ 12 | "transform-vue-jsx", 13 | "transform-runtime" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | end_of_line = lf 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | 12 | [*.md] 13 | insert_final_newline = false 14 | trim_trailing_whitespace = false 15 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | /dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | /test/unit/coverage/ 8 | 9 | # Editor directories and files 10 | .idea 11 | .vscode 12 | *.suo 13 | *.ntvs* 14 | *.njsproj 15 | *.sln 16 | ./config/prod.env.js 17 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | "postcss-import": {}, 6 | "postcss-url": {}, 7 | // to edit target browsers: use "browserslist" field in package.json 8 | "autoprefixer": {} 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: stable 3 | script: npm run test 4 | notifications: 5 | email: false 6 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017-present PanJiaChen 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 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/README.en.md: -------------------------------------------------------------------------------- 1 | # xiaoyuanboke-vue 2 | 3 | #### Description 4 | {**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} 5 | 6 | #### Software Architecture 7 | Software architecture description 8 | 9 | #### Installation 10 | 11 | 1. xxxx 12 | 2. xxxx 13 | 3. xxxx 14 | 15 | #### Instructions 16 | 17 | 1. xxxx 18 | 2. xxxx 19 | 3. xxxx 20 | 21 | #### Contribution 22 | 23 | 1. Fork the repository 24 | 2. Create Feat_xxx branch 25 | 3. Commit your code 26 | 4. Create Pull Request 27 | 28 | 29 | #### Gitee Feature 30 | 31 | 1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md 32 | 2. Gitee blog [blog.gitee.com](https://blog.gitee.com) 33 | 3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) 34 | 4. The most valuable open source project [GVP](https://gitee.com/gvp) 35 | 5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) 36 | 6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) 37 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/build/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/xiaoyuanboke-vue/build/logo.png -------------------------------------------------------------------------------- /xiaoyuanboke-vue/build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | //You can set the vue-loader configuration by yourself. 5 | } 6 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/config/dev.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const merge = require('webpack-merge') 3 | const prodEnv = require('./prod.env') 4 | 5 | module.exports = merge(prodEnv, { 6 | NODE_ENV: '"development"', 7 | // BASE_API: '"http://localhost:9001/back"', 8 | BASE_API: '"http://localhost:9004/back/api"', 9 | }) 10 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/config/prod.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = { 3 | NODE_ENV: '"production"', 4 | BASE_API: '"http://localhost/back/api"', 5 | } 6 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/xiaoyuanboke-vue/favicon.ico -------------------------------------------------------------------------------- /xiaoyuanboke-vue/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 小袁博客后台 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/api/blog/category.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export default { 4 | addCategory(categoryParam) { 5 | return request({ 6 | url: '/category', 7 | method: 'post', 8 | data: categoryParam 9 | }) 10 | }, 11 | 12 | deleteCategory(id) { 13 | return request({ 14 | url: `/category/${id}`, 15 | method: 'delete', 16 | }) 17 | }, 18 | 19 | editCategory(category) { 20 | return request({ 21 | url: '/category', 22 | method: 'put', 23 | data: category 24 | }) 25 | }, 26 | 27 | moveCategory(category) { 28 | return request({ 29 | url: '/category/move', 30 | method: 'put', 31 | data: category 32 | }) 33 | }, 34 | 35 | getCategoryList() { 36 | return request({ 37 | url: '/category', 38 | method: 'get' 39 | }) 40 | }, 41 | 42 | findParentCategory() { 43 | return request({ 44 | url: '/category/parent', 45 | method: 'get' 46 | }) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/api/blog/friendlink.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export default{ 4 | addFriendLink(friend) { 5 | return request({ 6 | url: '/friendlink', 7 | method: 'post', 8 | data: friend 9 | }) 10 | }, 11 | 12 | deleteFriendLink(id) { 13 | return request({ 14 | url: `/friendlink/${id}`, 15 | method: 'delete' 16 | }) 17 | }, 18 | 19 | editFriendLink(friend) { 20 | return request({ 21 | url: '/friendlink', 22 | method: 'put', 23 | data: friend 24 | }) 25 | }, 26 | 27 | findFriendLinkList(pageIndex, pageSize) { 28 | return request({ 29 | url: `/friendlink/${pageIndex}/${pageSize}`, 30 | method: 'get' 31 | }) 32 | }, 33 | 34 | } 35 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/api/blog/homeMessage.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export default { 4 | deleteMessage(id) { 5 | return request({ 6 | url: `/homeMessage/${id}`, 7 | method: 'delete' 8 | }) 9 | }, 10 | 11 | deleteMoreMessage(ids) { 12 | return request({ 13 | url: '/homeMessage', 14 | method: 'delete', 15 | data: ids 16 | }) 17 | }, 18 | 19 | editMessage(message) { 20 | return request({ 21 | url: '/homeMessage', 22 | method: 'put', 23 | data: message 24 | }) 25 | }, 26 | 27 | findMessageList(pageIndex, pageSize) { 28 | return request({ 29 | url: `/homeMessage/${pageIndex}/${pageSize}`, 30 | method: 'get' 31 | }) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/api/login.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function login(username, password) { 4 | return request({ 5 | url: '/system/login', 6 | method: 'post', 7 | data: { 8 | username, 9 | password 10 | } 11 | }) 12 | } 13 | 14 | export function getInfo() { 15 | return request({ 16 | url: '/system/getInfo', 17 | method: 'post', 18 | }) 19 | } 20 | 21 | export function logout() { 22 | return request({ 23 | url: '/system/logout', 24 | method: 'post' 25 | }) 26 | } 27 | 28 | export function wxLogin() { 29 | return request({ 30 | url: '/system/wx_login', 31 | method: 'get' 32 | }) 33 | } 34 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/api/system/role.js: -------------------------------------------------------------------------------- 1 | import request from "../../utils/request"; 2 | 3 | export default { 4 | getRoleList(param) { 5 | return request({ 6 | url: '/role/list', 7 | method: 'post', 8 | data: param 9 | }) 10 | }, 11 | 12 | updateRolePermission(param) { 13 | return request({ 14 | url: '/role/updatePermission', 15 | method: 'put', 16 | data: param 17 | }) 18 | }, 19 | 20 | insertRole(param) { 21 | return request({ 22 | url: '/role/insertRole', 23 | method: 'post', 24 | data: param 25 | }) 26 | }, 27 | 28 | deleteRole(param) { 29 | return request({ 30 | url: '/role/deleteRole', 31 | method: 'delete', 32 | data: param 33 | }) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/api/system/sysUser.js: -------------------------------------------------------------------------------- 1 | import request from "../../utils/request"; 2 | 3 | export default { 4 | getSysUserList(param) { 5 | return request({ 6 | url: '/system/getSysUserList', 7 | method: 'post', 8 | data: param 9 | }) 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/api/user.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export default { 4 | findUserList(queryParam) { 5 | return request({ 6 | url: '/user/list', 7 | method: 'post', 8 | data: queryParam 9 | }) 10 | }, 11 | 12 | findUserOperationList(queryParam) { 13 | return request({ 14 | url: '/user/list/operation', 15 | method: 'post', 16 | data: queryParam 17 | }) 18 | }, 19 | 20 | findOperationType() { 21 | return request({ 22 | url: '/userOperation/type', 23 | method: 'get' 24 | }) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/api/utils/qiniu.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export default { 4 | /** 5 | * 1.文章图片上传请求 6 | * @param {file} file 7 | * @returns 文件地址 8 | */ 9 | uploadArticleImage(file, folderName = '') { 10 | // 构造FormData 11 | let formDate = new FormData() 12 | formDate.append('file', file) 13 | formDate.append('folderName', folderName) 14 | // 返回请求模板 15 | return request({ 16 | url: '/qiniu/kodo/upload/articleImage', 17 | method: 'post', 18 | data: formDate, 19 | headers: { 20 | 'Content-Type': 'application/x-www-form-urlencoded', 21 | 'AK': 'xx', 22 | 'SK': 'xx' 23 | } 24 | }) 25 | }, 26 | } 27 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/assets/404_images/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/xiaoyuanboke-vue/src/assets/404_images/404.png -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/assets/404_images/404_cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/xiaoyuanboke-vue/src/assets/404_images/404_cloud.png -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/assets/img/login_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/xiaoyuanboke-vue/src/assets/img/login_bg.jpg -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/assets/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/xiaoyuanboke-vue/src/assets/img/logo.png -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/assets/img/weixinActive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/xiaoyuanboke-vue/src/assets/img/weixinActive.png -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/assets/img/weixinNoActive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/xiaoyuanboke-vue/src/assets/img/weixinNoActive.png -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/components/Pagination/index.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 47 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/components/SvgIcon/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 34 | 35 | 44 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/icons/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import SvgIcon from '@/components/SvgIcon' // svg组件 3 | 4 | // register globally 5 | Vue.component('svg-icon', SvgIcon) 6 | 7 | const requireAll = requireContext => requireContext.keys().map(requireContext) 8 | const req = require.context('./svg', false, /\.svg$/) 9 | requireAll(req) 10 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/icons/svg/add.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/icons/svg/article.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/icons/svg/example.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/icons/svg/eye.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/icons/svg/feedback.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/icons/svg/link.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/icons/svg/notice.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/icons/svg/password.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/icons/svg/publish.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/icons/svg/running.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/icons/svg/user.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/store/getters.js: -------------------------------------------------------------------------------- 1 | const getters = { 2 | sidebar: state => state.app.sidebar, 3 | device: state => state.app.device, 4 | token: state => state.user.token, 5 | avatar: state => state.user.avatar, 6 | name: state => state.user.name, 7 | sysUserCode: state => state.user.sysUserCode, 8 | roles: state => state.user.roles 9 | } 10 | export default getters 11 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | import app from './modules/app' 4 | import user from './modules/user' 5 | import getters from './getters' 6 | 7 | Vue.use(Vuex) 8 | 9 | const store = new Vuex.Store({ 10 | modules: { 11 | app, 12 | user 13 | }, 14 | getters 15 | }) 16 | 17 | export default store 18 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/store/modules/app.js: -------------------------------------------------------------------------------- 1 | import Cookies from 'js-cookie' 2 | 3 | const app = { 4 | state: { 5 | sidebar: { 6 | opened: !+Cookies.get('sidebarStatus'), 7 | withoutAnimation: false 8 | }, 9 | device: 'desktop' 10 | }, 11 | mutations: { 12 | TOGGLE_SIDEBAR: state => { 13 | if (state.sidebar.opened) { 14 | Cookies.set('sidebarStatus', 1) 15 | } else { 16 | Cookies.set('sidebarStatus', 0) 17 | } 18 | state.sidebar.opened = !state.sidebar.opened 19 | state.sidebar.withoutAnimation = false 20 | }, 21 | CLOSE_SIDEBAR: (state, withoutAnimation) => { 22 | Cookies.set('sidebarStatus', 1) 23 | state.sidebar.opened = false 24 | state.sidebar.withoutAnimation = withoutAnimation 25 | }, 26 | TOGGLE_DEVICE: (state, device) => { 27 | state.device = device 28 | } 29 | }, 30 | actions: { 31 | ToggleSideBar: ({ commit }) => { 32 | commit('TOGGLE_SIDEBAR') 33 | }, 34 | CloseSideBar({ commit }, { withoutAnimation }) { 35 | commit('CLOSE_SIDEBAR', withoutAnimation) 36 | }, 37 | ToggleDevice({ commit }, device) { 38 | commit('TOGGLE_DEVICE', device) 39 | } 40 | } 41 | } 42 | 43 | export default app 44 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/styles/element-ui.scss: -------------------------------------------------------------------------------- 1 | //to reset element-ui default css 2 | .el-upload { 3 | input[type="file"] { 4 | display: none !important; 5 | } 6 | } 7 | 8 | .el-upload__input { 9 | display: none; 10 | } 11 | 12 | //暂时性解决diolag 问题 https://github.com/ElemeFE/element/issues/2461 13 | .el-dialog { 14 | transform: none; 15 | left: 0; 16 | position: relative; 17 | margin: 0 auto; 18 | } 19 | 20 | //element ui upload 21 | .upload-container { 22 | .el-upload { 23 | width: 100%; 24 | .el-upload-dragger { 25 | width: 100%; 26 | height: 200px; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/styles/mixin.scss: -------------------------------------------------------------------------------- 1 | @mixin clearfix { 2 | &:after { 3 | content: ""; 4 | display: table; 5 | clear: both; 6 | } 7 | } 8 | 9 | @mixin scrollBar { 10 | &::-webkit-scrollbar-track-piece { 11 | background: #d3dce6; 12 | } 13 | &::-webkit-scrollbar { 14 | width: 6px; 15 | } 16 | &::-webkit-scrollbar-thumb { 17 | background: #99a9bf; 18 | border-radius: 20px; 19 | } 20 | } 21 | 22 | @mixin relative { 23 | position: relative; 24 | width: 100%; 25 | height: 100%; 26 | } 27 | 28 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/styles/transition.scss: -------------------------------------------------------------------------------- 1 | //globl transition css 2 | 3 | /*fade*/ 4 | .fade-enter-active, 5 | .fade-leave-active { 6 | transition: opacity 0.28s; 7 | } 8 | 9 | .fade-enter, 10 | .fade-leave-active { 11 | opacity: 0; 12 | } 13 | 14 | /*fade-transform*/ 15 | .fade-transform-leave-active, 16 | .fade-transform-enter-active { 17 | transition: all .5s; 18 | } 19 | .fade-transform-enter { 20 | opacity: 0; 21 | transform: translateX(-30px); 22 | } 23 | .fade-transform-leave-to { 24 | opacity: 0; 25 | transform: translateX(30px); 26 | } 27 | 28 | /*fade*/ 29 | .breadcrumb-enter-active, 30 | .breadcrumb-leave-active { 31 | transition: all .5s; 32 | } 33 | 34 | .breadcrumb-enter, 35 | .breadcrumb-leave-active { 36 | opacity: 0; 37 | transform: translateX(20px); 38 | } 39 | 40 | .breadcrumb-move { 41 | transition: all .5s; 42 | } 43 | 44 | .breadcrumb-leave-active { 45 | position: absolute; 46 | } 47 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/styles/variables.scss: -------------------------------------------------------------------------------- 1 | //sidebar 2 | // $menuBg:#304156; 3 | // $subMenuBg:#1f2d3d; 4 | // $menuHover:#001528; 5 | 6 | $menuBg:#304156; 7 | $subMenuBg:#3a444f; 8 | $menuHover:#001528; -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/styles/xy/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/xiaoyuanboke-vue/src/styles/xy/iconfont.ttf -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/styles/xy/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/xiaoyuanboke-vue/src/styles/xy/iconfont.woff -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/styles/xy/iconfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/xiaoyuanboke-vue/src/styles/xy/iconfont.woff2 -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/utils/auth.js: -------------------------------------------------------------------------------- 1 | import Cookies from 'js-cookie' 2 | 3 | const TokenKey = 'token' 4 | 5 | export function getToken() { 6 | return Cookies.get(TokenKey) 7 | } 8 | 9 | export function setToken(token) { 10 | return Cookies.set(TokenKey, token) 11 | } 12 | 13 | export function removeToken() { 14 | return Cookies.remove(TokenKey) 15 | } 16 | 17 | export function isAuth(permission) { 18 | let permissions = localStorage.getItem("permissions"); 19 | let flag = false 20 | 21 | if (!permissions) { 22 | return flag 23 | } 24 | 25 | for (let one of permission) { 26 | if (permissions.includes(one)) { 27 | flag = true 28 | break; 29 | } 30 | } 31 | return flag; 32 | } 33 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/views/article/draft/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 21 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/views/article/schedule/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 16 | 17 | 20 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/views/layout/components/AppMain.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 21 | 22 | 31 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/views/layout/components/Sidebar/Item.vue: -------------------------------------------------------------------------------- 1 | 30 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/views/layout/components/Sidebar/Link.vue: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 47 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/views/layout/components/Sidebar/index.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 40 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/views/layout/components/index.js: -------------------------------------------------------------------------------- 1 | export { default as Navbar } from './Navbar' 2 | export { default as Sidebar } from './Sidebar' 3 | export { default as AppMain } from './AppMain' 4 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/views/layout/mixin/ResizeHandler.js: -------------------------------------------------------------------------------- 1 | import store from '@/store' 2 | 3 | const { body } = document 4 | const WIDTH = 1024 5 | const RATIO = 3 6 | 7 | export default { 8 | watch: { 9 | $route(route) { 10 | if (this.device === 'mobile' && this.sidebar.opened) { 11 | store.dispatch('CloseSideBar', { withoutAnimation: false }) 12 | } 13 | } 14 | }, 15 | beforeMount() { 16 | window.addEventListener('resize', this.resizeHandler) 17 | }, 18 | mounted() { 19 | const isMobile = this.isMobile() 20 | if (isMobile) { 21 | store.dispatch('ToggleDevice', 'mobile') 22 | store.dispatch('CloseSideBar', { withoutAnimation: true }) 23 | } 24 | }, 25 | methods: { 26 | isMobile() { 27 | const rect = body.getBoundingClientRect() 28 | return rect.width - RATIO < WIDTH 29 | }, 30 | resizeHandler() { 31 | if (!document.hidden) { 32 | const isMobile = this.isMobile() 33 | store.dispatch('ToggleDevice', isMobile ? 'mobile' : 'desktop') 34 | 35 | if (isMobile) { 36 | store.dispatch('CloseSideBar', { withoutAnimation: true }) 37 | } 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/views/login/wxLogin.js: -------------------------------------------------------------------------------- 1 | !function (a, b, c) { 2 | function d(a) { 3 | var c = "default"; 4 | a.self_redirect === !0 ? c = "true" : a.self_redirect === !1 && (c = "false"); 5 | var d = b.createElement("iframe"), 6 | e = "https://open.weixin.qq.com/connect/qrconnect?appid=" + a.appid + "&scope=" + a.scope + "&redirect_uri=" + a.redirect_uri + "&state=" + a.state + "&login_type=jssdk&self_redirect=" + c + '&styletype=' + (a.styletype || '') + '&sizetype=' + (a.sizetype || '') + '&bgcolor=' + (a.bgcolor || '') + '&rst=' + (a.rst || ''); 7 | e += a.style ? "&style=" + a.style : "", e += a.href ? "&href=" + a.href : "", d.src = e, d.frameBorder = "0", d.allowTransparency = "true", d.scrolling = "no", d.width = "300px", d.height = "400px"; 8 | var f = b.getElementById(a.id); 9 | f.innerHTML = "", f.appendChild(d) 10 | } 11 | 12 | a.WxLogin = d 13 | }(window, document); 14 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/views/notice/article/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 16 | 17 | 20 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/views/notice/renew/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 16 | 17 | 20 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/views/system/permission/index.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 38 | 39 | 44 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/src/views/system/user/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 20 | 21 | 26 | -------------------------------------------------------------------------------- /xiaoyuanboke-vue/static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanprogrammer/xiaoyuanboke/25d6686404cdca21d678d4abca8ea0684aefe44a/xiaoyuanboke-vue/static/.gitkeep -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/annotation/IsAdmin.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.annotation; 2 | 3 | import java.lang.annotation.*; 4 | 5 | @Target({ElementType.PARAMETER}) 6 | @Retention(RetentionPolicy.RUNTIME) 7 | @Documented 8 | public @interface IsAdmin { 9 | } 10 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/annotation/MultiRequestBody.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * Controller中方法接收多个JSON对象 10 | * @date 2018/08/27 11 | * @author tongyao 12 | */ 13 | @Target(ElementType.PARAMETER) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | public @interface MultiRequestBody { 16 | /** 17 | * 是否必须出现的参数 18 | */ 19 | boolean required() default true; 20 | 21 | /** 22 | * 当value的值或者参数名不匹配时,是否允许解析最外层属性到该对象 23 | */ 24 | boolean parseAllFields() default true; 25 | 26 | /** 27 | * 解析时用到的JSON的key 28 | */ 29 | String value() default ""; 30 | } 31 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/constants/CookieConstant.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.constants; 2 | 3 | /** 4 | * FileName: CookieConstant 5 | * Author: 小袁 6 | * Date: 2022/5/3 17:30 7 | * Description: 8 | */ 9 | public interface CookieConstant { 10 | 11 | String TOKEN = "USER_TOKEN"; // token名字 12 | int EXPIRE = 24 * 60 * 60; // Cookie有效时间 s 13 | } 14 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/constants/MatchConstants.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.constants; 2 | 3 | /** 4 | * FileName: MatchConstants 5 | * Author: 小袁教程 6 | * Date: 2022/9/3 11:23 7 | * Description: 正则表达式 8 | */ 9 | 10 | public interface MatchConstants { 11 | 12 | // 密码匹配 13 | String password = ""; 14 | 15 | // 邮箱匹配 16 | String email = "^([a-zA-Z0-9]+[-_\\.]?)+@[a-zA-Z0-9]+\\.[a-z]+$"; 17 | 18 | // 号码匹配 19 | String phone = "^[1][3,4,5,7,8][0-9]{9}$"; 20 | } 21 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/constants/MessageQueueConstants.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.constants; 2 | 3 | public interface MessageQueueConstants { 4 | 5 | String NOTICE_VIRTUAL = "notice-host"; 6 | 7 | String NOTICE_QUEUE = "NOTICE-QUEUE"; 8 | 9 | String NOTICE_ROUTING = "NOTICE-ROUTING"; 10 | 11 | String NOTICE_EXCHANGE = "NOTICE-Direct-Exchange"; 12 | } 13 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/constants/RedisConstantKey.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.constants; 2 | 3 | /** 4 | * FileName: TokenConstant 5 | * Author: 小袁 6 | * Date: 2022/5/9 10:01 7 | * Description: 8 | */ 9 | public interface RedisConstantKey { 10 | 11 | String USER = "USER_TOKEN_"; // 用户key前缀 12 | int USER_EXPIRE = 24 * 60 * 60; // 缓存时间(1天) 13 | 14 | String EMAIL = "EMAIL_"; // 邮箱前缀 15 | int EMAIL_EXPIRE = 5 * 60; // 缓存时间(五分钟) 16 | 17 | String MOBILE_NUMBER = "MOBILE_NUMBER_"; // 号码前缀 18 | int MOBILE_NUMBER_EXPIRE = 10 * 60; // 10分钟有效期 19 | 20 | String MOBILE_NUMBER_REQUEST_VERIFY = "MOBILE_NUMBER_REQUEST_VERIFY_"; // 发送短信前的权限码 21 | 22 | String EMAIL_REQUEST_VERIFY = "EMAIL_REQUEST_VERIFY_"; // 发送邮箱前的权限码 23 | 24 | int EXPIRE_TEN_SECOND = 10; // 10s 25 | int EXPIRE_ONE_MINUTE = 60; // 1分钟 26 | } 27 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/constants/ResultCode.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.constants; 2 | 3 | /** 4 | * FileName: ResultCode 5 | * Author: 小袁 6 | * Date: 2022/3/12 12:13 7 | * Description: 统一返回的状态码 8 | */ 9 | public interface ResultCode { 10 | 11 | Integer SUCCESS = 200; //成功 12 | 13 | Integer ERROR = 20001; //失败 14 | } 15 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/constants/defaults/SystemDefaultConstants.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.constants.defaults; 2 | 3 | import com.xiaoyuan.common.util.RandomUtil; 4 | 5 | public interface SystemDefaultConstants { 6 | 7 | String SYS_USER_AVATAR = "https://file.xiaoyuan-boke.com/user/avatar/user_avatar_default.jpeg"; 8 | String SYS_USER_CODE = "sysUser:" + RandomUtil.randomStrUUID(true); 9 | String SYS_USER_ROLE_ID = "[6]"; 10 | String SYS_USER_NICKNAME = "笔者"; 11 | Integer SYS_USER_STATE = 0; 12 | } 13 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/constants/valid/NotChinese.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.constants.valid; 2 | 3 | import com.xiaoyuan.common.util.StringMatch; 4 | import org.springframework.stereotype.Component; 5 | 6 | import javax.validation.Constraint; 7 | import javax.validation.ConstraintValidator; 8 | import javax.validation.ConstraintValidatorContext; 9 | import javax.validation.Payload; 10 | import java.lang.annotation.*; 11 | 12 | @Documented 13 | @Target({ElementType.FIELD, ElementType.PARAMETER}) //定义可以在字段上使用 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Constraint(validatedBy = NotChinese.isContainChinese.class) 16 | public @interface NotChinese { 17 | 18 | String message() default "不能包含中文字符"; 19 | 20 | Class[] groups() default {}; 21 | 22 | Class[] payload() default {}; 23 | 24 | @Component 25 | class isContainChinese implements ConstraintValidator { 26 | 27 | @Override 28 | public boolean isValid(String str, ConstraintValidatorContext constraintValidatorContext) { 29 | return !StringMatch.isContainsChinese(str); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/constants/valid/NotEmoji.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.constants.valid; 2 | 3 | import com.xiaoyuan.common.util.StringMatch; 4 | import org.springframework.stereotype.Component; 5 | 6 | import javax.validation.Constraint; 7 | import javax.validation.ConstraintValidator; 8 | import javax.validation.ConstraintValidatorContext; 9 | import javax.validation.Payload; 10 | import java.lang.annotation.*; 11 | 12 | @Documented 13 | @Target({ElementType.FIELD, ElementType.PARAMETER}) //定义可以在字段上使用 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Constraint(validatedBy = NotEmoji.isContainEmoji.class) 16 | public @interface NotEmoji { 17 | 18 | String message() default "不能包含表情符号"; 19 | 20 | Class[] groups() default {}; 21 | 22 | Class[] payload() default {}; 23 | 24 | @Component 25 | class isContainEmoji implements ConstraintValidator { 26 | 27 | @Override 28 | public boolean isValid(String str, ConstraintValidatorContext constraintValidatorContext) { 29 | return !StringMatch.isContainsEmoji(str); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/constants/valid/Number.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.constants.valid; 2 | 3 | import com.xiaoyuan.common.util.StringMatch; 4 | import org.springframework.stereotype.Component; 5 | 6 | import javax.validation.Constraint; 7 | import javax.validation.ConstraintValidator; 8 | import javax.validation.ConstraintValidatorContext; 9 | import javax.validation.Payload; 10 | import java.lang.annotation.*; 11 | 12 | @Documented 13 | @Target({ElementType.FIELD, ElementType.PARAMETER}) //定义可以在字段上使用 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Constraint(validatedBy = Number.checkNumber.class) 16 | public @interface Number { 17 | 18 | String message() default "编号错误"; 19 | 20 | Class[] groups() default {}; 21 | 22 | Class[] payload() default {}; 23 | 24 | @Component 25 | class checkNumber implements ConstraintValidator { 26 | 27 | @Override 28 | public boolean isValid(String number, ConstraintValidatorContext constraintValidatorContext) { 29 | return StringMatch.checkNumber(number); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/convert/TextOperation.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.convert; 2 | 3 | import org.jsoup.Jsoup; 4 | 5 | /** 6 | * FileName: getTextFromHTML 7 | * Author: 小袁 8 | * Date: 2022/4/16 17:46 9 | * Description: 10 | */ 11 | public class TextOperation { 12 | 13 | public static String getTextFromHtml(String html) { 14 | return Jsoup.parse(html).text(); 15 | } 16 | 17 | public static String getArticleDigestFromText(String text) { 18 | if (text.length() <= 128) { 19 | return text; 20 | }else { 21 | return text.substring(0, 128); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/enums/BaseCodeEnum.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.enums; 2 | 3 | public interface BaseCodeEnum { 4 | 5 | Integer getCode(); 6 | 7 | String getName(); 8 | } 9 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/enums/JobStateEnum.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.enums; 2 | 3 | public enum JobStateEnum implements BaseCodeEnum { 4 | 5 | READY(1, "等待执行"), 6 | RUN(2, "执行中"), 7 | FINISH(3, "已结束"), 8 | INTERRUPT(4, "中断"), 9 | STOP(5, "停止"), 10 | EXCEPTIONAL(6, "异常") 11 | ; 12 | 13 | private Integer code; 14 | 15 | private String name; 16 | 17 | JobStateEnum(Integer code, String name) { 18 | this.code = code; 19 | this.name = name; 20 | } 21 | 22 | @Override 23 | public Integer getCode() { 24 | return this.code; 25 | } 26 | 27 | @Override 28 | public String getName() { 29 | return this.name; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/enums/MessageEnum.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.enums; 2 | 3 | public enum MessageEnum implements BaseCodeEnum { 4 | 5 | COLLECTION_NOTICE(1, "收藏通知"), 6 | LIKE_NOTICE(2, "点赞通知"), 7 | COMMENT_NOTICE(3, "评论通知"), 8 | REPLY_NOTICE(4, "回复通知"), 9 | ONE_CHAT(5, "单人聊天"), 10 | MORE_CHAT(6, "群发聊天"), 11 | PULL_UNREAD_MESSAGE(7, "拉取离线消息"), 12 | 13 | TO_BE_SEND(100, "待发送"), 14 | TO_BE_RECEIVE(101, "待接收"), 15 | SENDING(102, "发送中"), 16 | ALREADY_RECEIVE_CONFIRM(103, "已接收确认"), 17 | ALREADY_RECEIVE_NOT_CONFIRM(104, "接收未确认") 18 | ; 19 | 20 | private Integer code; 21 | 22 | private String name; 23 | 24 | MessageEnum(Integer code, String name) { 25 | this.code = code; 26 | this.name = name; 27 | } 28 | 29 | @Override 30 | public Integer getCode() { 31 | return this.code; 32 | } 33 | 34 | @Override 35 | public String getName() { 36 | return this.name; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/log/config/InitAutoConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.log.config; 2 | 3 | import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | @Configuration 8 | public class InitAutoConfiguration { 9 | 10 | @Bean 11 | @ConditionalOnClass(InitSystemLogConfiguration.class) 12 | public InitSystemLogConfiguration initSystemLogConfiguration() { 13 | return new InitSystemLogConfiguration(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/log/config/LogNoticeConfig.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.log.config; 2 | 3 | import com.xiaoyuan.common.log.service.LogNotice; 4 | import org.springframework.stereotype.Component; 5 | 6 | import java.util.List; 7 | 8 | @Component 9 | public class LogNoticeConfig implements LogNotice { 10 | 11 | // 超时通知邮箱列表 12 | @Override 13 | public List timeCostNotice() { 14 | return null; 15 | } 16 | 17 | // 业务错误通知邮箱列表 18 | @Override 19 | public List serviceError() { 20 | return null; 21 | } 22 | 23 | // 系统异常通知邮箱列表 24 | @Override 25 | public List SystemErrorNotice() { 26 | return null; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/log/service/LogNotice.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.log.service; 2 | 3 | import java.util.List; 4 | 5 | public interface LogNotice { 6 | 7 | /** 8 | * 超时日志通知列表 9 | * 10 | * @return 要通知的邮箱列表 11 | */ 12 | List timeCostNotice(); 13 | 14 | /** 15 | * 业务错误日志通知列表 16 | * 17 | * @return 要通知的邮箱列表 18 | */ 19 | List serviceError(); 20 | 21 | /** 22 | * 系统异常日志通知列表 23 | * 24 | * @return 要通知的邮箱列表 25 | */ 26 | List SystemErrorNotice(); 27 | } 28 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/ArticleContentParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * FileName: ArticleContentParam 9 | * Author: 小袁 10 | * Date: 2022/4/16 11:43 11 | * Description: 12 | */ 13 | @Data 14 | public class ArticleContentParam implements Serializable { 15 | 16 | private static final long serialVersionUID = 1L; 17 | 18 | /** 19 | * markdown文本 20 | */ 21 | private String content; 22 | 23 | /** 24 | * html格式文本 25 | */ 26 | private String contentHtml; 27 | } 28 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/CategoryParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * FileName: CategoryParam 7 | * Author: 小袁 8 | * Date: 2022/5/7 10:56 9 | * Description: 10 | */ 11 | @Data 12 | public class CategoryParam { 13 | 14 | private String oneOrTwo; 15 | 16 | private String name; 17 | 18 | private Integer parentId; 19 | } 20 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/MessageParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param; 2 | 3 | import com.xiaoyuan.common.vo.BaseMessage; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | import java.io.Serializable; 8 | 9 | @Data 10 | @EqualsAndHashCode(callSuper = true) 11 | public class MessageParam extends BaseMessage implements Serializable { 12 | 13 | private static final long serialVersionUID = 1L; 14 | 15 | // 消息唯一ID 16 | private String id; 17 | 18 | // 状态 19 | private String status; 20 | 21 | // 消息类型 22 | private String type; 23 | 24 | // 消息发送时间,13位毫秒 25 | private Long sendTime; 26 | 27 | // 消息内容,如果type=file,此属性表示文件的URL地址 28 | private String content; 29 | 30 | // 文件大小 31 | private Integer fileSize; 32 | 33 | // 文件名称 34 | private String fileName; 35 | 36 | // 接收消息的联系人ID 37 | private String toContactId; 38 | 39 | // 消息发送人的信息 40 | private MessageSenderParam fromUser; 41 | } 42 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/MessageSenderParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class MessageSenderParam { 7 | 8 | private String id; 9 | 10 | private String displayName; 11 | 12 | private String avatar; 13 | } 14 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/SendSmsCodeParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param; 2 | 3 | import com.xiaoyuan.common.constants.MatchConstants; 4 | import lombok.Data; 5 | 6 | import javax.validation.constraints.NotNull; 7 | import javax.validation.constraints.Pattern; 8 | 9 | @Data 10 | public class SendSmsCodeParam { 11 | 12 | @NotNull 13 | @Pattern(regexp = MatchConstants.phone) 14 | private String phone; 15 | } 16 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/UserOperationParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param; 2 | 3 | import com.xiaoyuan.common.vo.PageUtils; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | * FileName: UsesrOperationParam 11 | * Author: 小袁教程 12 | * Date: 2022/6/7 12:14 13 | * Description: 14 | */ 15 | @Data 16 | @EqualsAndHashCode(callSuper = true) 17 | public class UserOperationParam extends PageUtils implements Serializable { 18 | 19 | private String nickname; 20 | 21 | private String username; 22 | 23 | private String email; 24 | 25 | private String mobileNumber; 26 | 27 | private String describe; 28 | 29 | private String operatedTime; 30 | } 31 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/UserQueryParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param; 2 | 3 | import com.xiaoyuan.common.vo.Pagination; 4 | import com.xiaoyuan.common.constants.MatchConstants; 5 | import lombok.Data; 6 | import lombok.EqualsAndHashCode; 7 | 8 | import javax.validation.constraints.NotNull; 9 | import javax.validation.constraints.Pattern; 10 | import java.io.Serializable; 11 | 12 | /** 13 | * FileName: UserQueryParam 14 | * Author: 小袁教程 15 | * Date: 2022/6/7 0:24 16 | * Description: 17 | */ 18 | @Data 19 | @EqualsAndHashCode(callSuper = true) 20 | public class UserQueryParam extends Pagination implements Serializable { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | private String id; 25 | 26 | private String username; 27 | 28 | private String nickname; 29 | 30 | @NotNull 31 | @Pattern(regexp = MatchConstants.email, message = "邮箱格式不正确") 32 | private String email; 33 | 34 | private String mobileNumber; 35 | 36 | private String gmtCreate; 37 | } 38 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/article/ArticleLikeParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.article; 2 | 3 | import com.xiaoyuan.common.vo.Pagination; 4 | import com.xiaoyuan.common.constants.valid.Number; 5 | import lombok.Data; 6 | import lombok.EqualsAndHashCode; 7 | 8 | import javax.validation.constraints.NotNull; 9 | 10 | @Data 11 | @EqualsAndHashCode(callSuper = true) 12 | public class ArticleLikeParam extends Pagination { 13 | 14 | @NotNull 15 | @Number 16 | private String number; 17 | } 18 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/article/ArticleQueryParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.article; 2 | 3 | import com.xiaoyuan.common.vo.Pagination; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | @Data 8 | @EqualsAndHashCode(callSuper = true) 9 | public class ArticleQueryParam extends Pagination { 10 | 11 | /** 12 | * 文章编号 13 | */ 14 | private String id; 15 | 16 | private String author; 17 | 18 | private String tag; 19 | 20 | private String title; 21 | 22 | private String sort; 23 | 24 | private String category; 25 | 26 | private String startTime; 27 | 28 | private String endTime; 29 | 30 | /** 31 | * 搜索词 32 | */ 33 | private String searchWord; 34 | 35 | /** 36 | * 排序条件 37 | */ 38 | private String sortCondition; 39 | 40 | /** 41 | * 是否管理员 42 | */ 43 | private String isAdmin; 44 | } 45 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/article/CategoryQueryParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.article; 2 | 3 | import com.xiaoyuan.common.vo.Pagination; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | import java.io.Serializable; 8 | 9 | @Data 10 | @EqualsAndHashCode(callSuper = true) 11 | public class CategoryQueryParam extends Pagination implements Serializable { 12 | 13 | private static final long serialVersionUID = 1L; 14 | 15 | private Integer categoryId; 16 | } 17 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/article/CommentDeleteParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.article; 2 | 3 | import com.xiaoyuan.common.constants.valid.Number; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class CommentDeleteParam { 8 | 9 | @Number 10 | private String number; 11 | } 12 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/comuser/FindPasswordParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.comuser; 2 | 3 | import lombok.Data; 4 | import org.hibernate.validator.constraints.Length; 5 | 6 | import javax.validation.constraints.NotNull; 7 | 8 | @Data 9 | public class FindPasswordParam { 10 | 11 | @NotNull 12 | private String account; 13 | 14 | @NotNull 15 | @Length(min = 6, max = 20) 16 | private String password; 17 | 18 | // 验证码 19 | @NotNull 20 | @Length(min = 6, max = 6) 21 | private String code; 22 | } 23 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/comuser/LoginParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.comuser; 2 | 3 | import com.xiaoyuan.common.constants.valid.NotChinese; 4 | import com.xiaoyuan.common.constants.valid.NotEmoji; 5 | import lombok.Data; 6 | import org.hibernate.validator.constraints.Length; 7 | 8 | import javax.validation.constraints.NotNull; 9 | 10 | /** 11 | * FileName: LoginParam 12 | * Author: 小袁 13 | * Date: 2022/5/1 22:53 14 | * Description: 15 | */ 16 | @Data 17 | public class LoginParam { 18 | 19 | @NotNull 20 | @NotEmoji 21 | @NotChinese 22 | @Length(max = 25) 23 | private String account; 24 | 25 | @NotNull 26 | @NotEmoji 27 | @NotChinese 28 | @Length(max = 20) 29 | private String password; 30 | } 31 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/comuser/ModifyPasswordParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.comuser; 2 | 3 | import com.xiaoyuan.common.constants.valid.NotChinese; 4 | import com.xiaoyuan.common.constants.valid.NotEmoji; 5 | import lombok.Data; 6 | import org.hibernate.validator.constraints.Length; 7 | 8 | import javax.validation.constraints.NotNull; 9 | 10 | @Data 11 | public class ModifyPasswordParam { 12 | 13 | @NotNull 14 | //@NotEmoji 15 | //@NotChinese 16 | @Length(min = 6, max = 20) 17 | private String password; 18 | 19 | @NotNull 20 | //@NotEmoji 21 | //@NotChinese 22 | @Length(min = 6, max = 20) 23 | private String passwordConfirm; 24 | } 25 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/comuser/RegisterParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.comuser; 2 | 3 | import com.xiaoyuan.common.constants.valid.NotChinese; 4 | import com.xiaoyuan.common.constants.valid.NotEmoji; 5 | import lombok.Data; 6 | import org.hibernate.validator.constraints.Length; 7 | 8 | import javax.validation.constraints.NotNull; 9 | 10 | @Data 11 | public class RegisterParam { 12 | 13 | @NotNull 14 | //@NotChinese 15 | //@NotEmoji 16 | private String account; 17 | 18 | @NotNull 19 | @Length(min = 6, max = 20) 20 | //@NotChinese 21 | //@NotEmoji 22 | private String password; 23 | 24 | @NotNull 25 | //@NotChinese 26 | //@NotEmoji 27 | private String passwordConfirm; 28 | 29 | /** 30 | * 1 -> 用户名登陆 31 | * 2 -> 邮箱登陆 32 | * 3 -> 手机号码登陆 33 | */ 34 | @NotNull 35 | private String select; 36 | 37 | // 验证码 38 | @NotNull 39 | private String code; 40 | } 41 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/mail/SendMailCodeParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.mail; 2 | 3 | import lombok.Data; 4 | 5 | import javax.validation.constraints.Email; 6 | import javax.validation.constraints.NotNull; 7 | 8 | @Data 9 | public class SendMailCodeParam { 10 | 11 | @NotNull 12 | @Email 13 | private String email; 14 | } 15 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/mail/SendMailParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.mail; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | @Data 8 | public class SendMailParam { 9 | 10 | private String to; 11 | 12 | private List tos; 13 | 14 | private String theme; 15 | 16 | private String content; 17 | 18 | private String[] cc; 19 | } 20 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/permission/DeleteActParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.permission; 2 | 3 | import lombok.Data; 4 | 5 | import javax.validation.constraints.NotNull; 6 | 7 | @Data 8 | public class DeleteActParam { 9 | 10 | @NotNull 11 | private Integer id; 12 | } 13 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/permission/DeleteModParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.permission; 2 | 3 | import lombok.Data; 4 | 5 | import javax.validation.constraints.NotNull; 6 | 7 | @Data 8 | public class DeleteModParam { 9 | 10 | @NotNull 11 | private Integer id; 12 | } 13 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/permission/InsertActParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.permission; 2 | 3 | import lombok.Data; 4 | 5 | import javax.validation.constraints.NotNull; 6 | 7 | @Data 8 | public class InsertActParam { 9 | 10 | @NotNull 11 | private String actKey; 12 | 13 | @NotNull 14 | private String actName; 15 | } 16 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/permission/InsertModParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.permission; 2 | 3 | import lombok.Data; 4 | 5 | import javax.validation.constraints.NotNull; 6 | 7 | @Data 8 | public class InsertModParam { 9 | 10 | @NotNull 11 | private String modKey; 12 | 13 | @NotNull 14 | private String modName; 15 | } 16 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/permission/UpdateActParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.permission; 2 | 3 | import lombok.Data; 4 | 5 | import javax.validation.constraints.NotNull; 6 | 7 | @Data 8 | public class UpdateActParam { 9 | 10 | @NotNull 11 | private Integer id; 12 | 13 | @NotNull 14 | private String actKey; 15 | 16 | @NotNull 17 | private String actName; 18 | } 19 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/permission/UpdateModParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.permission; 2 | 3 | import lombok.Data; 4 | 5 | import javax.validation.constraints.NotNull; 6 | 7 | @Data 8 | public class UpdateModParam { 9 | 10 | @NotNull 11 | private Integer id; 12 | 13 | @NotNull 14 | private String modKey; 15 | 16 | @NotNull 17 | private String modName; 18 | } 19 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/problem/ProblemQueryParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.problem; 2 | 3 | import com.xiaoyuan.common.vo.Pagination; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | @Data 8 | @EqualsAndHashCode(callSuper = true) 9 | public class ProblemQueryParam extends Pagination { 10 | 11 | private String id; 12 | 13 | private String email; 14 | 15 | private Integer problemState; 16 | 17 | private Integer noticeState; 18 | 19 | private String startTime; 20 | 21 | private String endTime; 22 | } 23 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/role/DeleteRoleParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.role; 2 | 3 | import lombok.Data; 4 | 5 | import javax.validation.constraints.NotNull; 6 | 7 | @Data 8 | public class DeleteRoleParam { 9 | 10 | @NotNull 11 | private Integer id; 12 | } 13 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/role/InsertRoleParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.role; 2 | 3 | import lombok.Data; 4 | import org.hibernate.validator.constraints.Length; 5 | 6 | import javax.validation.constraints.Max; 7 | import javax.validation.constraints.NotNull; 8 | import java.util.List; 9 | 10 | @Data 11 | public class InsertRoleParam { 12 | 13 | @NotNull 14 | @Length(max = 32) 15 | private String roleKey; 16 | 17 | @NotNull 18 | @Length(max = 32) 19 | private String roleName; 20 | 21 | @NotNull 22 | @Length(max = 64) 23 | private String describe; 24 | 25 | @NotNull 26 | private List permissions; 27 | } 28 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/role/PermissionRoleParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.role; 2 | 3 | import lombok.Data; 4 | 5 | import javax.validation.constraints.NotNull; 6 | import java.util.List; 7 | 8 | @Data 9 | public class PermissionRoleParam { 10 | 11 | @NotNull 12 | private String roleKey; 13 | 14 | @NotNull 15 | private List permissions; 16 | } 17 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/role/RoleQueryParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.role; 2 | 3 | import com.xiaoyuan.common.vo.Pagination; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | @Data 8 | @EqualsAndHashCode(callSuper = true) 9 | public class RoleQueryParam extends Pagination { 10 | 11 | private String roleName; 12 | } 13 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/sysuser/SysUserLoginParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.sysuser; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | 6 | import javax.validation.constraints.Max; 7 | import javax.validation.constraints.NotNull; 8 | 9 | @Data 10 | @Builder 11 | public class SysUserLoginParam { 12 | 13 | @NotNull 14 | // @Max(value = 32) 15 | private String username; 16 | 17 | @NotNull 18 | // @Max(value = 128) 19 | private String password; 20 | 21 | private String openId; 22 | } 23 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/sysuser/SysUserParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.sysuser; 2 | 3 | import lombok.Data; 4 | 5 | import javax.validation.constraints.NotNull; 6 | 7 | @Data 8 | public class SysUserParam { 9 | 10 | @NotNull 11 | private String id; 12 | } 13 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/sysuser/SysUserQueryParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.sysuser; 2 | 3 | import com.xiaoyuan.common.vo.Pagination; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | import java.io.Serializable; 8 | 9 | @Data 10 | @EqualsAndHashCode(callSuper = true) 11 | public class SysUserQueryParam extends Pagination implements Serializable { 12 | 13 | private static final long serialVersionUID = 1L; 14 | } 15 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/param/sysuser/WeChatRegisterParam.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.param.sysuser; 2 | 3 | import lombok.Data; 4 | 5 | import javax.validation.constraints.NotNull; 6 | 7 | @Data 8 | public class WeChatRegisterParam { 9 | 10 | @NotNull 11 | private String openId; 12 | } 13 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/pojo/ArticleCategory.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | import lombok.experimental.Accessors; 9 | 10 | /** 11 | * FileName: ArticleCategory 12 | * Author: 小袁 13 | * Date: 2022/4/16 18:07 14 | * Description: 文章表和分类表的中间表 15 | */ 16 | @Data 17 | @EqualsAndHashCode(callSuper = false) 18 | @Accessors(chain = true) 19 | @TableName(value = "xy_article_category") 20 | public class ArticleCategory { 21 | 22 | /** 23 | * 中间表的编号 24 | */ 25 | @TableId(value = "id", type = IdType.ASSIGN_ID) 26 | private Long id; 27 | 28 | /** 29 | * 文章编号 30 | */ 31 | private Long articleId; 32 | 33 | /** 34 | * 文章分类编号 35 | */ 36 | private Integer categoryId; 37 | } 38 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/pojo/ArticleCollect.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import lombok.experimental.Accessors; 7 | 8 | import java.io.Serializable; 9 | import java.util.Date; 10 | 11 | /** 12 | * FileName: ArticleCollect 13 | * Author: 小袁 14 | * Date: 2022/5/11 9:26 15 | * Description: 16 | */ 17 | @Data 18 | @EqualsAndHashCode(callSuper = false) 19 | @Accessors(chain = true) 20 | @TableName(value = "xy_article_collect") 21 | public class ArticleCollect implements Serializable { 22 | 23 | private final static long serialVersionUID = 1L; 24 | 25 | @TableId(value = "id", type = IdType.ASSIGN_ID) 26 | private Long id; 27 | 28 | private Long userId; 29 | 30 | private Long articleId; 31 | 32 | @TableField(fill = FieldFill.INSERT) 33 | private Date gmtCreate; 34 | } 35 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/pojo/ArticleComment.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import lombok.experimental.Accessors; 7 | 8 | import java.io.Serializable; 9 | import java.util.Date; 10 | 11 | /** 12 | * FileName: ArticleComment 13 | * Author: 小袁 14 | * Date: 2022/5/3 19:28 15 | * Description: 16 | */ 17 | @Data 18 | @EqualsAndHashCode(callSuper = false) 19 | @Accessors(chain = true) 20 | @TableName(value = "xy_article_comment") 21 | public class ArticleComment implements Serializable { 22 | 23 | private static final long serialVersionUID = 1L; 24 | 25 | /** 26 | * 评论编号, 主键 27 | */ 28 | @TableId(value = "id", type = IdType.ASSIGN_ID) 29 | private Long id; 30 | 31 | /** 32 | * 用户编号 33 | */ 34 | private Long userId; 35 | 36 | /** 37 | * 文章编号 38 | */ 39 | private Long articleId; 40 | 41 | /** 42 | * 父级评论 43 | */ 44 | private Long parentId; 45 | 46 | /** 47 | * 评论内容 48 | */ 49 | private String content; 50 | 51 | @TableField(fill = FieldFill.INSERT) 52 | private Date gmtCreate; 53 | } 54 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/pojo/ArticleContent.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | import lombok.experimental.Accessors; 9 | 10 | import java.io.Serializable; 11 | 12 | /** 13 | * FileName: ArticleContent 14 | * Author: 小袁 15 | * Date: 2022/4/16 11:40 16 | * Description: 文章内容表(markdown文本和html文本) 17 | */ 18 | @Data 19 | @EqualsAndHashCode(callSuper = false) 20 | @Accessors(chain = true) 21 | @TableName(value = "xy_article_content") 22 | public class ArticleContent implements Serializable { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | /** 27 | * 编号 28 | */ 29 | @TableId(value = "id", type = IdType.ASSIGN_ID) 30 | private Long id; 31 | 32 | /** 33 | * 文章编号 34 | */ 35 | private Long articleId; 36 | 37 | /** 38 | * markdown文本 39 | */ 40 | private String content; 41 | 42 | /** 43 | * html格式文本 44 | */ 45 | private String contentHtml; 46 | } 47 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/pojo/ArticleLike.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.util.Date; 8 | 9 | /** 10 | * FileName: ArticleLike 11 | * Author: 小袁 12 | * Date: 2022/5/11 9:25 13 | * Description: 文章点赞中间表 14 | */ 15 | @Data 16 | @TableName(value = "xy_article_like") 17 | public class ArticleLike implements Serializable { 18 | 19 | private static final long serialVersionUID = 1L; 20 | 21 | @TableId(value = "id", type = IdType.ASSIGN_ID) 22 | private Long id; 23 | 24 | private Long userId; 25 | 26 | private Long articleId; 27 | 28 | @TableField(fill = FieldFill.INSERT) 29 | private Date gmtCreate; 30 | } 31 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/pojo/Category.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | import lombok.experimental.Accessors; 9 | 10 | import java.io.Serializable; 11 | 12 | /** 13 | * FileName: Category 14 | * Author: 小袁 15 | * Date: 2022/4/15 10:42 16 | * Description: 分类实体 17 | */ 18 | @Data 19 | @EqualsAndHashCode(callSuper = false) 20 | @Accessors(chain = true) // 调用Setting方法后 回传对象 21 | @TableName(value = "xy_category") 22 | public class Category implements Serializable{ 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | /** 27 | * 分类ID 28 | */ 29 | @TableId(value = "id", type = IdType.AUTO) 30 | private Integer id; 31 | 32 | /** 33 | * 分类栏目名称 34 | */ 35 | private String name; 36 | 37 | /** 38 | * 父级栏目 39 | */ 40 | private Integer parentId; 41 | } 42 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/pojo/Job.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.IdType; 5 | import com.baomidou.mybatisplus.annotation.TableField; 6 | import com.baomidou.mybatisplus.annotation.TableId; 7 | import lombok.Data; 8 | 9 | import java.io.Serializable; 10 | import java.util.Date; 11 | 12 | @Data 13 | public class Job implements Serializable { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | @TableId(value = "id", type = IdType.AUTO) 18 | private Integer id; 19 | 20 | @TableField(value = "job_name") 21 | private String jobName; 22 | 23 | private String jobKey; 24 | 25 | private String runCount; 26 | 27 | private String jobState; 28 | 29 | private String startTime; 30 | 31 | private String endTime; 32 | 33 | /** 34 | * 创建时间 35 | */ 36 | @TableField(fill = FieldFill.INSERT) 37 | private Date gmtCreate; 38 | 39 | /** 40 | * 修改时间 41 | */ 42 | @TableField(fill = FieldFill.INSERT_UPDATE) 43 | private Date gmtUpdate; 44 | } 45 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/pojo/SuggestFeedback.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import lombok.experimental.Accessors; 7 | 8 | import java.io.Serializable; 9 | import java.util.Date; 10 | 11 | /** 12 | * FileName: SuggestFeedback 13 | * Author: 小袁 14 | * Date: 2022/4/28 19:08 15 | * Description: 建议反馈 表 16 | */ 17 | @Data 18 | @EqualsAndHashCode(callSuper = false) 19 | @Accessors(chain = true) 20 | @TableName(value = "xy_suggest_feedback") 21 | public class SuggestFeedback implements Serializable { 22 | 23 | private static final long serialVersionUID = 1L; 24 | 25 | @TableId(value = "id", type = IdType.AUTO) 26 | private Integer id; 27 | 28 | /** 29 | * 建议人 30 | */ 31 | private String name; 32 | 33 | /** 34 | * 建议内容 35 | */ 36 | private String content; 37 | 38 | /** 39 | * 反馈时间 40 | */ 41 | @TableField(fill = FieldFill.INSERT) 42 | private Date gmtCreate; 43 | } 44 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/pojo/SysAction.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.pojo; 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 lombok.Data; 8 | 9 | import java.io.Serializable; 10 | 11 | @Data 12 | @TableName(value = "sys_action") 13 | public class SysAction implements Serializable { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | @TableId(value = "id", type = IdType.AUTO) 18 | private Integer id; 19 | 20 | @TableField(value = "act_key") 21 | private String actKey; 22 | 23 | @TableField(value = "act_name") 24 | private String actName; 25 | } 26 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/pojo/SysModule.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.pojo; 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 lombok.Data; 8 | 9 | import java.io.Serializable; 10 | 11 | @Data 12 | @TableName(value = "sys_module") 13 | public class SysModule implements Serializable { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | @TableId(value = "id", type = IdType.AUTO) 18 | private Integer id; 19 | 20 | @TableField(value = "mod_key") 21 | private String modKey; 22 | 23 | @TableField(value = "mod_name") 24 | private String modName; 25 | } 26 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/pojo/SysPermission.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | 8 | @Data 9 | @TableName(value = "sys_permission") 10 | public class SysPermission { 11 | 12 | @TableId(value = "id", type = IdType.AUTO) 13 | private Integer id; 14 | 15 | private Integer moduleId; 16 | 17 | private Integer actionId; 18 | } 19 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/pojo/SysRole.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.pojo; 2 | 3 | import cn.hutool.json.JSONObject; 4 | import com.baomidou.mybatisplus.annotation.IdType; 5 | import com.baomidou.mybatisplus.annotation.TableField; 6 | import com.baomidou.mybatisplus.annotation.TableId; 7 | import com.baomidou.mybatisplus.annotation.TableName; 8 | import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | import lombok.experimental.Accessors; 12 | 13 | import java.io.Serializable; 14 | import java.util.List; 15 | 16 | @Data 17 | @EqualsAndHashCode(callSuper = false) 18 | @Accessors(chain = true) 19 | @TableName(value = "sys_role") 20 | public class SysRole implements Serializable { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | @TableId(value = "id", type = IdType.AUTO) 25 | private Integer id; 26 | 27 | @TableField(value = "role_key") 28 | private String roleKey; 29 | 30 | @TableField(value = "role_name") 31 | private String roleName; 32 | 33 | @TableField(value = "permissions") 34 | private Object permissions; 35 | 36 | @TableField(value = "`describe`") 37 | private String describe; 38 | } 39 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/pojo/SysUser.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.pojo; 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 lombok.Builder; 8 | import lombok.Data; 9 | 10 | import java.io.Serializable; 11 | 12 | @Data 13 | @TableName(value = "sys_user") 14 | public class SysUser implements Serializable { 15 | 16 | private static final long serialVersionUID = 1L; 17 | 18 | @TableId(value = "id", type = IdType.AUTO) 19 | private Integer id; 20 | 21 | private Object roleId; 22 | 23 | @TableField(value = "sys_user_code") 24 | private String SysUserCode; 25 | 26 | private String openId; 27 | 28 | private String username; 29 | 30 | private String password; 31 | 32 | private String nickname; 33 | 34 | private String avatar; 35 | 36 | private String sex; 37 | 38 | private Integer state; 39 | } 40 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/pojo/UserOperation.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.util.Date; 8 | 9 | /** 10 | * FileName: UserOperation 11 | * Author: 小袁教程 12 | * Date: 2022/5/17 15:46 13 | * Description: 14 | */ 15 | @Data 16 | @TableName(value = "xy_user_operation") 17 | public class UserOperation implements Serializable { 18 | 19 | private static final long serialVersionUID = 1L; 20 | 21 | @TableId(value = "id", type = IdType.AUTO) 22 | private Long id; 23 | 24 | private Long userId; 25 | 26 | @TableField(value = "`describe`") 27 | private String describe; 28 | 29 | @TableField(fill = FieldFill.INSERT) 30 | private Date gmtCreate; 31 | } 32 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/util/ConverterUtil.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.util; 2 | 3 | public class ConverterUtil { 4 | 5 | public static String viewNumberFormat(Integer number) { 6 | if (number < 10000) { 7 | return number.toString(); 8 | }else if (number <= 100000) { 9 | return number / 1000 % 10 == 0 ? number / 10000 + "万+" : number / 10000 + "." + number / 1000 % 10 + "万+"; 10 | }else { 11 | return number / 10000 + "万+"; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/util/ExceptionUtil.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.util; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | import java.io.StringWriter; 6 | 7 | public class ExceptionUtil { 8 | 9 | public static String getMessage(Exception e) { 10 | StringWriter sw = null; 11 | PrintWriter pw = null; 12 | try { 13 | sw = new StringWriter(); 14 | pw = new PrintWriter(sw); 15 | // 将出错的栈信息输出到printWriter中 16 | e.printStackTrace(pw); 17 | pw.flush(); 18 | sw.flush(); 19 | } finally { 20 | if (sw != null) { 21 | try { 22 | sw.close(); 23 | } catch (IOException e1) { 24 | e1.printStackTrace(); 25 | } 26 | } 27 | if (pw != null) { 28 | pw.close(); 29 | } 30 | } 31 | return sw.toString(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/util/RandomUtil.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.util; 2 | 3 | import java.util.Random; 4 | import java.util.UUID; 5 | 6 | public final class RandomUtil { 7 | 8 | private RandomUtil() {} 9 | 10 | /** 11 | * 随机生成六位数字验证码 12 | */ 13 | public static String randomSixCode() { 14 | return String.valueOf(new Random().nextInt(899999) + 100000); 15 | } 16 | 17 | public static String randomStrUUID(boolean isWhole) { 18 | return isWhole ? UUID.randomUUID().toString() : UUID.randomUUID().toString().replaceAll("-", ""); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/vo/CommonUserVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.vo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonInclude; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.util.Date; 8 | 9 | /** 10 | * FileName: CommonUserVo 11 | * Author: 小袁 12 | * Date: 2022/4/18 16:30 13 | * Description: 14 | */ 15 | @Data 16 | @JsonInclude(JsonInclude.Include.NON_NULL) 17 | public class CommonUserVo implements Serializable { 18 | 19 | private final static long serialVersionUID = 1L; 20 | 21 | private String id; 22 | 23 | private String username; 24 | 25 | private String nickname; 26 | 27 | private String email; 28 | 29 | private String mobileNumber; 30 | 31 | private String wechatNumber; 32 | 33 | private String avatar; 34 | 35 | private Date gmtCreate; 36 | 37 | private Date gmtLogin; 38 | } 39 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/vo/FriendLinkVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.vo; 2 | 3 | import cn.hutool.core.date.DateUtil; 4 | import lombok.Data; 5 | 6 | /** 7 | * FileName: FriendLinkVo 8 | * Author: 小袁 9 | * Date: 2022/4/30 15:04 10 | * Description: 11 | */ 12 | @Data 13 | public class FriendLinkVo { 14 | 15 | /** 16 | * 昵称 17 | */ 18 | private String nickname; 19 | 20 | /** 21 | * 简单描述 22 | */ 23 | private String describe; 24 | 25 | /** 26 | * 链接 27 | */ 28 | private String link; 29 | } 30 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/vo/HomeMessageVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | 8 | /** 9 | * FileName: HomeMessageVo 10 | * Author: 小袁 11 | * Date: 2022/5/1 8:39 12 | * Description: 13 | */ 14 | @Data 15 | public class HomeMessageVo implements Serializable { 16 | 17 | private final static long serialVersionUID = 1L; 18 | 19 | private String id; 20 | 21 | /** 22 | * 留言人编号 23 | */ 24 | private String authorId; 25 | 26 | /** 27 | * 简述留言(正面) 28 | */ 29 | private String content; 30 | 31 | /** 32 | * 详细留言(背面, 可选) 33 | */ 34 | private String detailContent; 35 | 36 | /** 37 | * 背景图(随机) 38 | */ 39 | private String background; 40 | 41 | /** 42 | * 留言时间 43 | */ 44 | private Date gmtCreate; 45 | } 46 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/vo/PageUtils.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.vo; 2 | 3 | import lombok.Data; 4 | import lombok.NoArgsConstructor; 5 | 6 | import java.io.Serializable; 7 | import java.util.List; 8 | 9 | /** 10 | * FileName: PageUtils 11 | * Author: 小袁 12 | * Date: 2022/4/16 12:44 13 | * Description: 分页工具 14 | */ 15 | @Data 16 | @NoArgsConstructor 17 | public class PageUtils implements Serializable { 18 | private static final long serialVersionUID = 1L; 19 | /** 20 | * 总记录数 21 | */ 22 | private long totalCount; 23 | /** 24 | * 每页记录数 25 | */ 26 | private int pageSize; 27 | /** 28 | * 总页数 29 | */ 30 | private int totalPage; 31 | /** 32 | * 当前页数 33 | */ 34 | private int pageIndex; 35 | /** 36 | * 列表数据 37 | */ 38 | private List list; 39 | 40 | public PageUtils(List list, long totalCount, int pageIndex, int pageSize) { 41 | this.list = list; 42 | this.totalCount = totalCount; 43 | this.pageSize = pageSize; 44 | this.pageIndex = pageIndex; 45 | this.totalPage = (int) Math.ceil((double) totalCount / pageSize); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/vo/PageVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | @Data 8 | public class PageVo implements Serializable { 9 | 10 | private static final long serialVersionUID = 1L; 11 | 12 | private long total; 13 | 14 | private T list; 15 | 16 | public PageVo(T list, long total) { 17 | this.list = list; 18 | this.total = total; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/vo/Pagination.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | @Data 8 | public class Pagination implements Serializable { 9 | 10 | private static final long serialVersionUID = 1L; 11 | 12 | private int pageIndex = 1; 13 | 14 | private int pageSize = 10; 15 | } 16 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/vo/ProblemFeedbackVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * FileName: ProblemFeedbackVo 9 | * Author: 小袁 10 | * Date: 2022/4/21 8:49 11 | * Description: 问题反馈 param 12 | */ 13 | @Data 14 | public class ProblemFeedbackVo implements Serializable { 15 | 16 | private final static long serialVersionUID = 1L; 17 | 18 | /** 19 | * 编号 20 | */ 21 | private String id; 22 | 23 | /** 24 | * 邮箱 25 | */ 26 | private String email; 27 | 28 | /** 29 | * 问题描述 30 | */ 31 | private String problem; 32 | 33 | /** 34 | * 问题状态 35 | */ 36 | private Character problemState; 37 | 38 | /** 39 | * 通知状态 40 | */ 41 | private Character noticeState; 42 | 43 | /** 44 | * 反馈时间 45 | */ 46 | private String createTime; 47 | } 48 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/vo/SysNoticeVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.vo; 2 | 3 | import lombok.Data; 4 | import lombok.EqualsAndHashCode; 5 | 6 | import java.io.Serializable; 7 | 8 | @Data 9 | @EqualsAndHashCode(callSuper = true) 10 | public class SysNoticeVo extends BaseMessage implements Serializable { 11 | 12 | private static final long serialVersionUID = 1L; 13 | 14 | private String title; 15 | 16 | private String content; 17 | 18 | private String readTime; 19 | 20 | private String noticeTime; 21 | 22 | private Integer noticeType; 23 | } 24 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/vo/SysPermissionVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.vo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonInclude; 4 | import lombok.Data; 5 | 6 | @Data 7 | @JsonInclude(JsonInclude.Include.NON_NULL) 8 | public class SysPermissionVo { 9 | 10 | /** 11 | * 权限ID 12 | */ 13 | private Integer id; 14 | 15 | /** 16 | * 操作编号 17 | */ 18 | private String actKey; 19 | 20 | /** 21 | * 操作 22 | */ 23 | private String actName; 24 | 25 | /** 26 | * 模块编号 27 | */ 28 | private String modKey; 29 | 30 | /** 31 | * 模块 32 | */ 33 | private String modName; 34 | } 35 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/vo/SysRoleVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.vo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonInclude; 4 | import lombok.Data; 5 | 6 | @Data 7 | @JsonInclude(JsonInclude.Include.NON_NULL) 8 | public class SysRoleVo { 9 | 10 | private Integer id; 11 | 12 | private String roleKey; 13 | 14 | private String roleName; 15 | 16 | private Object permissions; 17 | 18 | private String describe; 19 | } 20 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/vo/TimeLineVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * FileName: TimeLineVo 9 | * Author: 小袁 10 | * Date: 2022/4/20 12:34 11 | * Description: 12 | */ 13 | @Data 14 | public class TimeLineVo implements Serializable { 15 | 16 | private final static long serialVersionUID = 1L; 17 | 18 | private String id; 19 | 20 | private String title; 21 | 22 | private String describe; 23 | 24 | private String content; 25 | 26 | private String startTime; 27 | 28 | private String endTime; 29 | } 30 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/vo/UserOperationVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * FileName: UserOperationVo 9 | * Author: 小袁教程 10 | * Date: 2022/6/7 12:08 11 | * Description: 12 | */ 13 | @Data 14 | public class UserOperationVo implements Serializable { 15 | 16 | private final static long serialVersionUID = 1L; 17 | 18 | private Integer id; 19 | 20 | private String nickname; 21 | 22 | private String username; 23 | 24 | private String email; 25 | 26 | private String mobileNumber; 27 | 28 | private String wechatNumber; 29 | 30 | private String avatar; 31 | 32 | private String describe; 33 | 34 | private String operatedTime; 35 | } 36 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/vo/article/ArticleCommentVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.vo.article; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * FileName: ArticleCommentVo 7 | * Author: 小袁 8 | * Date: 2022/5/3 20:17 9 | * Description: 10 | */ 11 | @Data 12 | public class ArticleCommentVo { 13 | 14 | private String number; 15 | 16 | private String avatar; 17 | 18 | private String nickname; 19 | 20 | private String content; 21 | 22 | /** 23 | * 是否当前登录本人的评论 24 | * 0 -> 不是或者当前登录无账号 25 | * 1 -> 是本人, 显示编辑和删除操作 26 | */ 27 | private String status; 28 | 29 | private String commentTime; 30 | } 31 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/vo/article/ArticleOperationVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.vo.article; 2 | 3 | import com.fasterxml.jackson.annotation.JsonInclude; 4 | import lombok.Data; 5 | 6 | /** 7 | * FileName: ArticleLikeVo 8 | * Author: 小袁教程 9 | * Date: 2022/5/14 12:09 10 | * Description: 11 | */ 12 | @Data 13 | @JsonInclude(JsonInclude.Include.NON_NULL) 14 | public class ArticleOperationVo { 15 | 16 | // 点赞数量 17 | private Integer likeCount; 18 | 19 | // 收藏数量 20 | private Integer collectCount; 21 | 22 | // 状态 23 | private Boolean status; 24 | } 25 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/vo/article/ArticlePublishVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.vo.article; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.List; 7 | 8 | /** 9 | * FileName: ArticlePublishVo 10 | * Author: 小袁 11 | * Date: 2022/4/19 16:47 12 | * Description: 13 | */ 14 | @Data 15 | public class ArticlePublishVo implements Serializable { 16 | 17 | private final static long serialVersionUID = 1L; 18 | 19 | private String title; 20 | 21 | private String digest; 22 | 23 | private String cover; 24 | 25 | private String content; 26 | 27 | private String tags; 28 | 29 | private List> categorySelected; 30 | } 31 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/vo/article/RecommendArticleVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.vo.article; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * FileName: HostArticleVo 7 | * Author: 小袁 8 | * Date: 2022/4/24 17:33 9 | * Description: 10 | */ 11 | @Data 12 | public class RecommendArticleVo { 13 | 14 | private String number; 15 | 16 | private String title; 17 | } 18 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/vo/category/CategoryChildrenVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.vo.category; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * FileName: CategoryChildrenVo 9 | * Author: 小袁 10 | * Date: 2022/4/15 14:18 11 | * Description: 子分类 12 | */ 13 | @Data 14 | public class CategoryChildrenVo implements Serializable { 15 | 16 | private final static long serialVersionUID = 1L; 17 | 18 | // ID编号 19 | private Integer childrenId; 20 | 21 | // 分类栏目名称 22 | private String childrenName; 23 | } 24 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/vo/category/CategoryNameVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.vo.category; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * FileName: CategoryNameVo 9 | * Author: 小袁 10 | * Date: 2022/4/17 13:14 11 | * Description: 只有分类名的对象 12 | */ 13 | @Data 14 | public class CategoryNameVo implements Serializable { 15 | 16 | private final static long serialVersionUID = 1L; 17 | 18 | // 分类名称 19 | private String name; 20 | } 21 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/vo/category/CategoryParentVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.vo.category; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.List; 7 | 8 | /** 9 | * FileName: CategoryVo 10 | * Author: 小袁 11 | * Date: 2022/4/15 14:16 12 | * Description: 13 | */ 14 | @Data 15 | public class CategoryParentVo implements Serializable { 16 | 17 | private final static long serialVersionUID = 1L; 18 | 19 | // 父级分类编号ID 20 | private Integer parentId; 21 | 22 | // 父级分类名称 23 | private String parentName; 24 | 25 | // 子分类 26 | private List childrenCategory; 27 | } 28 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/vo/category/CategoryVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.vo.category; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.List; 7 | 8 | /** 9 | * FileName: CategoryVo 10 | * Author: 小袁 11 | * Date: 2022/5/10 19:12 12 | * Description: 13 | */ 14 | @Data 15 | public class CategoryVo implements Serializable { 16 | 17 | private final static long serialVersionUID = 1L; 18 | 19 | /** 20 | * 分类编号 21 | */ 22 | private Integer id; 23 | 24 | /** 25 | * 分类名称 26 | */ 27 | private String name; 28 | 29 | /** 30 | * 文章总数 31 | */ 32 | private int count; 33 | 34 | /** 35 | * 子分类 36 | */ 37 | private List children; 38 | } 39 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/vo/sysuser/SysUserVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.vo.sysuser; 2 | 3 | import com.fasterxml.jackson.annotation.JsonInclude; 4 | import com.xiaoyuan.common.vo.SysRoleVo; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Builder; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | 10 | import java.util.List; 11 | import java.util.Set; 12 | 13 | @Data 14 | @Builder 15 | @NoArgsConstructor 16 | @AllArgsConstructor 17 | @JsonInclude(JsonInclude.Include.NON_NULL) 18 | public class SysUserVo { 19 | 20 | /** 21 | * 昵称 22 | */ 23 | private String nickname; 24 | 25 | /** 26 | * 头像 27 | */ 28 | private String avatar; 29 | 30 | /** 31 | * 编号 32 | */ 33 | private String sysUserCode; 34 | 35 | /** 36 | * 状态 37 | */ 38 | private String state; 39 | 40 | /** 41 | * 发布文章数量 42 | */ 43 | private String articleCount; 44 | 45 | /** 46 | * 角色集合 47 | */ 48 | private List roles; 49 | 50 | /** 51 | * 权限集合 52 | */ 53 | private Set permissions; 54 | } 55 | -------------------------------------------------------------------------------- /xy-common/src/main/java/com/xiaoyuan/common/vo/sysuser/WxVo.java: -------------------------------------------------------------------------------- 1 | package com.xiaoyuan.common.vo.sysuser; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class WxVo { 7 | 8 | private String access_token; 9 | 10 | private String expires_in; 11 | 12 | private String refresh_token; 13 | 14 | private String openid; 15 | 16 | private String scope; 17 | 18 | private String unionid; 19 | 20 | private String errcode; 21 | 22 | private String invalid; 23 | } 24 | -------------------------------------------------------------------------------- /xy-common/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.xiaoyuan.common.log.config.InitAutoConfiguration,\ 2 | com.xiaoyuan.common.log.aspect.GlobalLogAspect 3 | --------------------------------------------------------------------------------