├── .gitattributes ├── .gitignore ├── README.md ├── pom.xml ├── src ├── main │ ├── java │ │ └── com │ │ │ └── ssm │ │ │ ├── config │ │ │ ├── DecodeProperties.java │ │ │ └── EncryptPropertyPlaceholderConfigurer.java │ │ │ ├── dao │ │ │ ├── BaseMapping.java │ │ │ └── IpMapper.java │ │ │ ├── entity │ │ │ ├── BaseEntity.java │ │ │ └── Ip.java │ │ │ ├── mapping │ │ │ └── IpMapper.xml │ │ │ └── util │ │ │ ├── AES.java │ │ │ └── UnicodeUtil.java │ └── resources │ │ ├── config.properties │ │ ├── log4j.properties │ │ ├── spring-mybatis.xml │ │ └── spring.xml └── test │ └── java │ └── uifuture │ └── TestConfig.java ├── ssm-classLoader ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── uifuture │ ├── classloader │ └── ClassLoaderTest.java │ ├── config │ └── CustomClassLoader.java │ └── entity │ └── User.java ├── ssm-design-pattern ├── README.md ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── uifuture │ ├── factory │ ├── abstractfactory │ │ ├── TestAbstractFactory.java │ │ ├── abstractfactory │ │ │ └── PayFactory.java │ │ ├── abstractproduct │ │ │ ├── AliPay.java │ │ │ └── WxPay.java │ │ ├── concreatefactory │ │ │ ├── AndroidPayFactory.java │ │ │ └── IOSFactory.java │ │ └── concreteproduct │ │ │ ├── AndroidAliPay.java │ │ │ ├── AndroidWxPay.java │ │ │ ├── IOSAliPay.java │ │ │ └── IOSWxPay.java │ ├── method │ │ ├── Pay.java │ │ ├── PayFactory.java │ │ ├── TestPayFactory.java │ │ └── impl │ │ │ ├── AliPayImpl.java │ │ │ ├── AliPayImplFactory.java │ │ │ ├── WxPayImpl.java │ │ │ └── WxPayImplFactory.java │ └── simple │ │ ├── Pay.java │ │ ├── PayFactory.java │ │ ├── TestPayFactory.java │ │ └── impl │ │ ├── AliPayImpl.java │ │ └── WxPayImpl.java │ ├── mvc │ ├── MVCDemo.java │ ├── User.java │ ├── UserController.java │ └── UserView.java │ ├── singleton │ ├── eager │ │ └── EagerSingleton.java │ └── idler │ │ ├── DCLThreadSafeSingleton.java │ │ ├── StaticThreadSafeSingleton.java │ │ ├── ThreadSafeSingleton.java │ │ └── ThreadUnsafeSingleton.java │ ├── strategy │ ├── Context.java │ ├── Strategy.java │ ├── TestClient.java │ └── impl │ │ ├── EveningStrategyImpl.java │ │ ├── MorningStrategyImpl.java │ │ └── NooningStrategyImpl.java │ └── template │ ├── AbstractTemplateRole.java │ ├── TestClient.java │ └── impl │ ├── BlackTeaImpl.java │ └── GreenTeaImpl.java ├── ssm-mq-aliyun ├── README.md ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── uifuture │ └── ssm │ └── mq │ └── aliyun │ ├── ConsumeResult.java │ ├── MQConsumer.java │ ├── MQProducer.java │ ├── ons │ ├── ComsumeResultAdapter.java │ ├── ONSConsumerInvoker.java │ ├── ONSCustomerConnConfig.java │ ├── ONSProducer.java │ ├── ONSProducerConnConfig.java │ └── ONSProducerInvoker.java │ └── util │ └── CollectionUtils.java ├── ssm-mybatis-generator ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── uifuture │ │ ├── GeneratorMain.java │ │ ├── GeneratorMain2.java │ │ ├── dao │ │ ├── BlogMapper.java │ │ └── UsersMapper.java │ │ ├── entity │ │ ├── Blog.java │ │ └── Users.java │ │ └── mapper │ │ ├── BlogMapper.xml │ │ └── UsersMapper.xml │ └── resources │ ├── generator.properties │ └── generatorConfig.xml ├── ssm-mybatis-module └── pom.xml ├── ssm-mybatis-transaction ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── uifuture │ │ │ └── chapter17 │ │ │ ├── domain │ │ │ ├── base │ │ │ │ └── BaseEntity.java │ │ │ └── entity │ │ │ │ └── UsersEntity.java │ │ │ ├── mapper │ │ │ ├── UsersMapper.java │ │ │ └── xml │ │ │ │ └── UsersMapper.xml │ │ │ └── service │ │ │ ├── IUsersService.java │ │ │ └── impl │ │ │ └── UsersServiceImpl.java │ └── resources │ │ ├── application-service.xml │ │ ├── applicationContext.xml │ │ ├── jdbc.properties │ │ ├── logback.xml │ │ └── sql │ │ └── users.sql │ └── test │ └── java │ └── com │ └── uifuture │ └── chapter17 │ ├── BaseTest.java │ ├── CodeGenerator.java │ └── UsersServiceImplTest.java ├── ssm-mybatis-xml-config ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── uifuture │ │ │ └── chapter12 │ │ │ ├── base │ │ │ └── BaseEntity.java │ │ │ ├── dao │ │ │ ├── BlogMapper.java │ │ │ ├── PostMapper.java │ │ │ └── UsersMapper.java │ │ │ ├── entity │ │ │ ├── Blog.java │ │ │ ├── BlogExt.java │ │ │ ├── Post.java │ │ │ └── Users.java │ │ │ └── mapper │ │ │ ├── BlogMapper.xml │ │ │ ├── PostMapper.xml │ │ │ └── UsersMapper.xml │ └── resources │ │ ├── jdbc.properties │ │ ├── logback.xml │ │ ├── mybatis-config.xml │ │ ├── select-insert-update-delete-demo.xml │ │ └── sql │ │ ├── chapter-10-ssm.sql │ │ └── users.sql │ └── test │ └── java │ └── com │ └── uifuture │ ├── chapter11 │ └── dao │ │ ├── BlogMapperTest.java │ │ └── UsersMapperTest.java │ └── chapter12 │ └── dao │ └── BlogMapperTest.java ├── ssm-proxy ├── README.md ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── uifuture │ ├── dynamicproxy │ ├── cglib │ │ ├── AliPay.java │ │ ├── PayProxy.java │ │ └── TestProxy.java │ └── jdk │ │ ├── PayProxy.java │ │ ├── PayProxyOptimize.java │ │ ├── Store.java │ │ ├── StoreOptimize.java │ │ └── target │ │ ├── AliPay.java │ │ ├── Pay.java │ │ └── WxPay.java │ └── staticproxy │ ├── PayProxy.java │ ├── Store.java │ └── target │ ├── AliPay.java │ └── Pay.java ├── ssm-reflection-demo ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── uifuture │ │ ├── classdemo │ │ ├── BeanUtilsByGenerics.java │ │ ├── BeanUtilsNoGenerics.java │ │ ├── ClassDemo.java │ │ ├── GetClassExampleOne.java │ │ ├── GetClassExampleThree.java │ │ ├── GetClassExampleTwo.java │ │ └── Users.java │ │ ├── factorydemo │ │ ├── TestFactory.java │ │ ├── api │ │ │ └── Worker.java │ │ ├── factory │ │ │ └── WorkerFactory.java │ │ └── impl │ │ │ ├── WorkerOneImpl.java │ │ │ └── WorkerTwoImpl.java │ │ └── helloword │ │ ├── ReflectionHelloWord.java │ │ └── entity │ │ └── Person.java │ └── resources │ └── worker.properties ├── ssm-spring-aop ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── uifuture │ │ │ └── spring │ │ │ └── aop │ │ │ ├── annotation │ │ │ ├── RentingService.java │ │ │ ├── aspect │ │ │ │ ├── RentingAspect.java │ │ │ │ └── RentingAspectPointcut.java │ │ │ └── impl │ │ │ │ └── RentingServiceImpl.java │ │ │ └── xml │ │ │ ├── PrintLog.java │ │ │ └── service │ │ │ ├── UserService.java │ │ │ └── impl │ │ │ └── UserServiceImpl.java │ └── resources │ │ └── spring-content.xml │ └── test │ └── java │ ├── Test.java │ └── com │ └── uifuture │ └── spring │ └── aop │ ├── annotation │ └── RentingServiceImplTest.java │ └── xml │ └── service │ └── impl │ └── UserServiceImplTest.java ├── ssm-spring-core-bean ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── uifuture │ │ │ └── spring │ │ │ └── core │ │ │ └── bean │ │ │ ├── condition │ │ │ ├── condition │ │ │ │ ├── LinuxCondition.java │ │ │ │ ├── MacConditional.java │ │ │ │ └── WindowsCondition.java │ │ │ ├── config │ │ │ │ └── UserConfig.java │ │ │ └── entity │ │ │ │ └── User.java │ │ │ ├── config │ │ │ └── SpringBeanConfig.java │ │ │ ├── createbean │ │ │ ├── Animal.java │ │ │ ├── AnimalBeanExampleFactory.java │ │ │ ├── AnimalBeanFactory.java │ │ │ ├── Cat.java │ │ │ └── Dog.java │ │ │ ├── dao │ │ │ └── UserDao.java │ │ │ ├── entity │ │ │ └── Chinese.java │ │ │ ├── event │ │ │ ├── RegisterEvent.java │ │ │ └── RegisterListener.java │ │ │ ├── life │ │ │ ├── LifeAnnotationService.java │ │ │ ├── LifeService.java │ │ │ └── LifeXmlService.java │ │ │ ├── service │ │ │ └── UserServiceImpl.java │ │ │ └── task │ │ │ └── PrintTimeTask.java │ └── resources │ │ ├── annotation-spring-content.xml │ │ ├── bean-spring-content.xml │ │ ├── event-spring-content.xml │ │ ├── schema-spring-content.xml │ │ ├── spring-content-create-bean-example.xml │ │ ├── spring-content-create-bean.xml │ │ ├── spring-content-task.xml │ │ └── spring-content.xml │ └── test │ └── java │ └── com │ └── uifuture │ └── spring │ └── core │ └── bean │ ├── entity │ ├── ChineseTest.java │ ├── ConditionTest.java │ ├── CreateBeanTest.java │ ├── EventTest.java │ └── TaskTest.java │ └── spel │ └── SpELTest.java ├── ssm-spring-ioc-demo ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── uifuture │ │ │ └── ssm │ │ │ └── spring │ │ │ └── ioc │ │ │ ├── demo14_1 │ │ │ └── Person.java │ │ │ ├── demo14_2 │ │ │ └── Person.java │ │ │ ├── demo14_5 │ │ │ ├── Say.java │ │ │ ├── ioc │ │ │ │ └── Person.java │ │ │ └── oop │ │ │ │ └── Person.java │ │ │ ├── demo14_6 │ │ │ ├── ioc │ │ │ │ ├── Pay.java │ │ │ │ └── impl │ │ │ │ │ ├── AliPayImpl.java │ │ │ │ │ ├── PayImpl.java │ │ │ │ │ └── WxPayImpl.java │ │ │ └── terrible │ │ │ │ └── PayImpl.java │ │ │ ├── demo14_7 │ │ │ ├── config │ │ │ │ └── BeanConfiguration.java │ │ │ ├── constructor │ │ │ ├── dao │ │ │ │ ├── SpringIoCDao.java │ │ │ │ └── impl │ │ │ │ │ └── SpringIoCDaoImpl.java │ │ │ ├── gather │ │ │ │ └── GatherEntity.java │ │ │ ├── interface_injection │ │ │ │ ├── code_14_35 │ │ │ │ │ └── ClassA.java │ │ │ │ ├── code_14_36 │ │ │ │ │ └── ClassA.java │ │ │ │ └── code_14_37 │ │ │ │ │ └── MyServlet.java │ │ │ └── service │ │ │ │ ├── SpringIoCService.java │ │ │ │ └── impl │ │ │ │ └── SpringIoCServiceImpl.java │ │ │ └── entity │ │ │ └── ObjectTarget.java │ └── resources │ │ ├── spring-ioc-constructor-ab.xml │ │ ├── spring-ioc-constructor.xml │ │ ├── spring-ioc-gather.xml │ │ └── spring-ioc.xml │ └── test │ └── java │ └── com │ └── uifuture │ └── ssm │ └── spring │ └── ioc │ └── demo14_7 │ ├── constructor │ ├── gather │ └── GatherEntityTest.java │ └── service │ └── SpringIoCServiceTest.java ├── ssm-spring-mvc ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── uifuture │ │ └── basics │ │ ├── advice │ │ └── ExceptionAdvice.java │ │ ├── commons │ │ ├── ResultCodeEnum.java │ │ └── ResultModel.java │ │ ├── config │ │ ├── MvcConfig.java │ │ ├── StaticResourcesVersion.java │ │ └── WebInitializer.java │ │ ├── controller │ │ ├── AnnotationController.java │ │ ├── BeanNameController.java │ │ ├── ExceptionController.java │ │ ├── FileController.java │ │ ├── IndexController.java │ │ ├── JsonController.java │ │ ├── ThemeCutController.java │ │ ├── cache │ │ │ └── StaticCacheController.java │ │ ├── forward │ │ │ ├── ModelAndViewForwardController.java │ │ │ ├── RequestForwardController.java │ │ │ └── StringForwardController.java │ │ └── redirect │ │ │ ├── ModelAndViewRedirectController.java │ │ │ ├── OtherRedirectController.java │ │ │ └── RedirectViewRedirectController.java │ │ ├── exception │ │ └── ExceptionResolver.java │ │ ├── filter │ │ ├── SensitiveWordFilter.java │ │ └── SensitiveWordServiceFilter.java │ │ ├── form │ │ └── User.java │ │ ├── interceptor │ │ └── LoginHanderInterceptor.java │ │ ├── service │ │ ├── SensitiveWordService.java │ │ └── impl │ │ │ └── SensitiveWordServiceImpl.java │ │ └── util │ │ ├── FileUtils.java │ │ └── GZIPUtils.java │ └── resources │ ├── globalization │ ├── i18n.properties │ ├── i18n_en_US.properties │ └── i18n_zh_CN.properties │ ├── logback.xml │ ├── spring-mvc-servlet.xml │ ├── static │ ├── css │ │ ├── blue.css │ │ ├── red.css │ │ ├── test.css │ │ └── test.css.gz │ ├── images │ │ ├── img1.jpg │ │ └── img1.jpg.gz │ ├── js │ │ ├── test.js │ │ └── test.js.gz │ ├── testStatic.html │ └── testStatic.html.gz │ ├── theme │ ├── default.properties │ └── red.properties │ └── views │ ├── cache │ └── index.jsp │ ├── download.jsp │ ├── error │ ├── error.jsp │ ├── httpMessageNotReadableException.jsp │ ├── httpMessageNotWritableException.jsp │ └── otherError.jsp │ ├── forward │ └── login.jsp │ ├── i18n │ └── index.jsp │ ├── index.jsp │ ├── redirect │ └── login.jsp │ ├── theme.jsp │ ├── upload │ ├── index.jsp │ └── message.jsp │ └── userInfo.jsp └── ssm-uifuture ├── .gitignore ├── pom.xml ├── src ├── main │ ├── java │ │ └── com │ │ │ └── uifuture │ │ │ └── ssm │ │ │ ├── aliyun │ │ │ ├── AliyunOssConfig.java │ │ │ ├── AliyunOssHandle.java │ │ │ ├── model │ │ │ │ └── UbBodyModel.java │ │ │ └── mq │ │ │ │ ├── MQConsumer.java │ │ │ │ └── SendMQ.java │ │ │ ├── aspect │ │ │ ├── ControllerLogAspect.java │ │ │ └── ServiceLogAspect.java │ │ │ ├── base │ │ │ ├── BaseController.java │ │ │ ├── BaseEntity.java │ │ │ ├── BaseException.java │ │ │ ├── BaseQueryBo.java │ │ │ └── page │ │ │ │ └── Page.java │ │ │ ├── bo │ │ │ ├── RResourceSubjectQueryBo.java │ │ │ ├── RResourceTagsQueryBo.java │ │ │ ├── RResourceTypeQueryBo.java │ │ │ ├── RUsersCollectionsQueryBo.java │ │ │ ├── SortQueryBo.java │ │ │ ├── TagsQueryBo.java │ │ │ ├── UsersCommentQueryBo.java │ │ │ ├── UsersFocusQueryBo.java │ │ │ └── UsersPayQueryBo.java │ │ │ ├── common │ │ │ ├── RedisConstants.java │ │ │ └── UsersConstants.java │ │ │ ├── config │ │ │ ├── DecodeProperties.java │ │ │ ├── EncryptPropertyPlaceholderConfigurer.java │ │ │ ├── InitCommentWordConfig.java │ │ │ └── SysConfig.java │ │ │ ├── controller │ │ │ ├── IpController.java │ │ │ ├── IpDetailsController.java │ │ │ ├── PayTypeController.java │ │ │ ├── RResourceSubjectController.java │ │ │ ├── RResourceTagsController.java │ │ │ ├── RResourceTypeController.java │ │ │ ├── RUsersCollectionsController.java │ │ │ ├── ResourceContentController.java │ │ │ ├── ResourceController.java │ │ │ ├── ResourceRestController.java │ │ │ ├── ResourceSubjectController.java │ │ │ ├── ResourceSubjectRestController.java │ │ │ ├── ResourceTypeController.java │ │ │ ├── ResourceTypeRestController.java │ │ │ ├── SensitiveWordController.java │ │ │ ├── StopWordController.java │ │ │ ├── TagsController.java │ │ │ ├── TagsRestController.java │ │ │ ├── TestController.java │ │ │ ├── UsersCommentController.java │ │ │ ├── UsersCommentRestController.java │ │ │ ├── UsersController.java │ │ │ ├── UsersFocusController.java │ │ │ ├── UsersFocusRestController.java │ │ │ ├── UsersPayController.java │ │ │ ├── UsersRechargeUbController.java │ │ │ └── UsersRestController.java │ │ │ ├── convert │ │ │ ├── ResourceContentConvert.java │ │ │ ├── ResourceConvert.java │ │ │ ├── ResourceSubjectConvert.java │ │ │ ├── ResourceTypeConvert.java │ │ │ ├── TagsConvert.java │ │ │ ├── UsersCommentConvert.java │ │ │ ├── UsersConvert.java │ │ │ └── UsersPayConvert.java │ │ │ ├── dto │ │ │ ├── FileInfoDTO.java │ │ │ ├── FileOssUrlDTO.java │ │ │ ├── PageDTO.java │ │ │ ├── RUsersCollectionsPageDTO.java │ │ │ ├── ResourceContentDTO.java │ │ │ ├── ResourceDTO.java │ │ │ ├── ResourcePageDTO.java │ │ │ ├── ResourceSubjectDTO.java │ │ │ ├── ResourceTypeDTO.java │ │ │ ├── TagsDTO.java │ │ │ ├── UsersCommentPageDTO.java │ │ │ ├── UsersCookieDTO.java │ │ │ ├── UsersFocusPageDTO.java │ │ │ └── UsersPayDTO.java │ │ │ ├── email │ │ │ ├── EmailConfig.java │ │ │ ├── SendEmail.java │ │ │ ├── SendPayCheckEmail.java │ │ │ └── impl │ │ │ │ ├── EmailConfigImpl.java │ │ │ │ ├── SendEmailCallable.java │ │ │ │ └── SendPayCheckEmailCallable.java │ │ │ ├── entity │ │ │ ├── IpDetailsEntity.java │ │ │ ├── IpEntity.java │ │ │ ├── PayTypeEntity.java │ │ │ ├── RResourceSubjectEntity.java │ │ │ ├── RResourceTagsEntity.java │ │ │ ├── RResourceTypeEntity.java │ │ │ ├── RUsersCollectionsEntity.java │ │ │ ├── ResourceContentEntity.java │ │ │ ├── ResourceEntity.java │ │ │ ├── ResourceSubjectEntity.java │ │ │ ├── ResourceTypeEntity.java │ │ │ ├── SensitiveWordEntity.java │ │ │ ├── StopWordEntity.java │ │ │ ├── TagsEntity.java │ │ │ ├── UsersCommentEntity.java │ │ │ ├── UsersEntity.java │ │ │ ├── UsersFocusEntity.java │ │ │ ├── UsersPayEntity.java │ │ │ └── UsersRechargeUbEntity.java │ │ │ ├── enums │ │ │ ├── DeleteEnum.java │ │ │ ├── MqTypeEnum.java │ │ │ ├── PayTypeEnNameEnum.java │ │ │ ├── ResourceStateEnum.java │ │ │ ├── ResultCodeEnum.java │ │ │ ├── UsersCommentEnum.java │ │ │ ├── UsersPayStateEnum.java │ │ │ ├── UsersStateEnum.java │ │ │ └── UsersTypeEnum.java │ │ │ ├── exception │ │ │ ├── CacheException.java │ │ │ ├── CheckoutException.java │ │ │ ├── CommonException.java │ │ │ ├── ParameterException.java │ │ │ ├── ServiceException.java │ │ │ └── handler │ │ │ │ └── ExceptionHandler.java │ │ │ ├── interceptors │ │ │ ├── AdminLoginInterceptor.java │ │ │ ├── AutoLoginInterceptor.java │ │ │ └── LoginInterceptor.java │ │ │ ├── mapper │ │ │ ├── IpDetailsMapper.java │ │ │ ├── IpMapper.java │ │ │ ├── PayTypeMapper.java │ │ │ ├── RResourceSubjectMapper.java │ │ │ ├── RResourceTagsMapper.java │ │ │ ├── RResourceTypeMapper.java │ │ │ ├── RUsersCollectionsMapper.java │ │ │ ├── ResourceContentMapper.java │ │ │ ├── ResourceMapper.java │ │ │ ├── ResourceSubjectMapper.java │ │ │ ├── ResourceTypeMapper.java │ │ │ ├── SensitiveWordMapper.java │ │ │ ├── StopWordMapper.java │ │ │ ├── TagsMapper.java │ │ │ ├── UsersCommentMapper.java │ │ │ ├── UsersFocusMapper.java │ │ │ ├── UsersMapper.java │ │ │ ├── UsersPayMapper.java │ │ │ └── UsersRechargeUbMapper.java │ │ │ ├── redis │ │ │ ├── AbstractClient.java │ │ │ ├── Client.java │ │ │ ├── RedisClient.java │ │ │ ├── RedisLock.java │ │ │ ├── config │ │ │ │ └── ConnConfig.java │ │ │ ├── listener │ │ │ │ ├── AppRedisMessagePublisher.java │ │ │ │ ├── AppRedisMessageSubcriber.java │ │ │ │ └── MessageData.java │ │ │ └── result │ │ │ │ └── CacheResult.java │ │ │ ├── req │ │ │ ├── ResourceReq.java │ │ │ ├── UsersCommentReq.java │ │ │ ├── UsersPayReq.java │ │ │ └── UsersReq.java │ │ │ ├── result │ │ │ └── ResultModel.java │ │ │ ├── service │ │ │ ├── IpDetailsService.java │ │ │ ├── IpService.java │ │ │ ├── PayTypeService.java │ │ │ ├── RResourceSubjectService.java │ │ │ ├── RResourceTagsService.java │ │ │ ├── RResourceTypeService.java │ │ │ ├── RUsersCollectionsService.java │ │ │ ├── ResourceContentService.java │ │ │ ├── ResourceService.java │ │ │ ├── ResourceSubjectService.java │ │ │ ├── ResourceTypeService.java │ │ │ ├── SensitiveWordService.java │ │ │ ├── StopWordService.java │ │ │ ├── TagsService.java │ │ │ ├── UsersCommentService.java │ │ │ ├── UsersFocusService.java │ │ │ ├── UsersPayService.java │ │ │ ├── UsersRechargeUbService.java │ │ │ ├── UsersService.java │ │ │ └── impl │ │ │ │ ├── IpDetailsServiceImpl.java │ │ │ │ ├── IpServiceImpl.java │ │ │ │ ├── PayTypeServiceImpl.java │ │ │ │ ├── RResourceSubjectServiceImpl.java │ │ │ │ ├── RResourceTagsServiceImpl.java │ │ │ │ ├── RResourceTypeServiceImpl.java │ │ │ │ ├── RUsersCollectionsServiceImpl.java │ │ │ │ ├── ResourceContentServiceImpl.java │ │ │ │ ├── ResourceServiceImpl.java │ │ │ │ ├── ResourceSubjectServiceImpl.java │ │ │ │ ├── ResourceTypeServiceImpl.java │ │ │ │ ├── SensitiveWordServiceImpl.java │ │ │ │ ├── StopWordServiceImpl.java │ │ │ │ ├── TagsServiceImpl.java │ │ │ │ ├── UsersCommentServiceImpl.java │ │ │ │ ├── UsersFocusServiceImpl.java │ │ │ │ ├── UsersPayServiceImpl.java │ │ │ │ ├── UsersRechargeUbServiceImpl.java │ │ │ │ └── UsersServiceImpl.java │ │ │ └── util │ │ │ ├── AES.java │ │ │ ├── BeanConvertUtils.java │ │ │ ├── CollectionUtils.java │ │ │ ├── CookieUtils.java │ │ │ ├── DateUtils.java │ │ │ ├── FileTypeUtils.java │ │ │ ├── FileUtils.java │ │ │ ├── IteratorsUtils.java │ │ │ ├── MD5Utils.java │ │ │ ├── PasswordUtils.java │ │ │ ├── RegexUtils.java │ │ │ ├── SessionUtils.java │ │ │ ├── UnicodeUtils.java │ │ │ ├── ValidateUtils.java │ │ │ ├── XssUtils.java │ │ │ └── word │ │ │ ├── BCConvert.java │ │ │ ├── FilterSet.java │ │ │ ├── WordFilterUtils.java │ │ │ └── WordNode.java │ └── resources │ │ ├── application-aop.xml │ │ ├── application-context.xml │ │ ├── application-mq.xml │ │ ├── application-mvc.xml │ │ ├── application-properties.xml │ │ ├── application-redis.xml │ │ ├── application-service.xml │ │ ├── application.xml │ │ ├── common.properties │ │ ├── config.properties │ │ ├── email.properties │ │ ├── log4j.properties │ │ ├── mapper │ │ ├── IpDetailsMapper.xml │ │ ├── IpMapper.xml │ │ ├── PayTypeMapper.xml │ │ ├── RResourceSubjectMapper.xml │ │ ├── RResourceTagsMapper.xml │ │ ├── RResourceTypeMapper.xml │ │ ├── RUsersCollectionsMapper.xml │ │ ├── ResourceContentMapper.xml │ │ ├── ResourceMapper.xml │ │ ├── ResourceSubjectMapper.xml │ │ ├── ResourceTypeMapper.xml │ │ ├── SensitiveWordMapper.xml │ │ ├── StopWordMapper.xml │ │ ├── TagsMapper.xml │ │ ├── UsersCommentMapper.xml │ │ ├── UsersFocusMapper.xml │ │ ├── UsersMapper.xml │ │ ├── UsersPayMapper.xml │ │ └── UsersRechargeUbMapper.xml │ │ ├── mq.properties │ │ ├── mybatis-config.xml │ │ ├── redis.properties │ │ └── sql │ │ ├── 20220820.sql │ │ └── uifuture.sql └── test │ └── java │ └── com │ └── uifuture │ └── ssm │ ├── BaseTest.java │ ├── MqTest.java │ ├── config │ ├── CodeGenerator.java │ └── TestConfig.java │ ├── controller │ ├── UsersPayControllerTest.java │ └── UsersRestControllerTest.java │ ├── email │ └── impl │ │ └── SendEmailCallableTest.java │ └── service │ └── impl │ ├── UsersPayServiceImplTest.java │ └── UsersServiceImplTest.java └── web └── WEB-INF ├── templates ├── index.ftl └── test │ ├── login.ftl │ ├── uploadFile.ftl │ └── uploadResources.ftl └── web.xml /.gitattributes: -------------------------------------------------------------------------------- 1 | *.js linguist-language=java 2 | *.css linguist-language=java 3 | *.html linguist-language=java 4 | *.sql linguist-language=java 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | *.class 19 | *.log 20 | */classes/artifacts/ 21 | 22 | classes 23 | logger 24 | 25 | ### maven ### 26 | .mvn 27 | 28 | ### log ### 29 | log.path_IS_UNDEFINED 30 | 31 | ### NetBeans ### 32 | /nbproject/private/ 33 | /build/ 34 | /nbbuild/ 35 | /dist/ 36 | /nbdist/ 37 | /.nb-gradle/ 38 | -------------------------------------------------------------------------------- /src/main/java/com/ssm/dao/IpMapper.java: -------------------------------------------------------------------------------- 1 | package com.ssm.dao; 2 | 3 | import com.ssm.entity.Ip; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository 7 | public interface IpMapper extends BaseMapping { 8 | } -------------------------------------------------------------------------------- /src/main/java/com/ssm/entity/BaseEntity.java: -------------------------------------------------------------------------------- 1 | package com.ssm.entity; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 所有实体类的超类 9 | */ 10 | @Data 11 | public class BaseEntity implements Serializable { 12 | private static final long serialVersionUID = -1549634521453074321L; 13 | // 相当于java类的身份证。主要用于版本控制 14 | protected Integer id; //主键,唯一标识符 15 | protected Integer createId; //创建者ID 16 | protected Integer alterId; //最后修改者ID 17 | protected Long createTime; //创建时间 18 | protected Long lastAlterTime; //最后更新时间 19 | protected String state; //删除标志 (1 正常, 0 删除) 20 | protected String description; //描述 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/ssm/entity/Ip.java: -------------------------------------------------------------------------------- 1 | package com.ssm.entity; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * ip 7 | */ 8 | @Data 9 | public class Ip extends BaseEntity { 10 | //用户Id 11 | private Integer userId; 12 | //ip地址 13 | private String ip; 14 | //登录时间 15 | private long loginTime; 16 | 17 | public Ip() { 18 | } 19 | 20 | public Ip(Integer userId, String ip, long loginTime) { 21 | this.userId = userId; 22 | this.ip = ip; 23 | this.loginTime = loginTime; 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/resources/config.properties: -------------------------------------------------------------------------------- 1 | driverClassName=com.mysql.jdbc.Driver 2 | jdbc_url=jdbc:mysql://localhost:3306/uifuture?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull 3 | jdbc_username=4B1F1099FE3DCDEE0C4B5ED079322488 4 | jdbc_password=F48A25E5C6CFCE140FEB01FBB941AE93 5 | #初始化连接大小 6 | jdbc_init=50 7 | #连接池最小空闲 8 | jdbc_minIdle=20 9 | #获取连接最大等待时间 单位为毫秒 10 | jdbc_maxActive=60000 11 | -------------------------------------------------------------------------------- /src/main/resources/spring-mybatis.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /ssm-classLoader/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | uifuture-ssm 7 | com.uifuture 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | ssm-classLoader 13 | 14 | 15 | -------------------------------------------------------------------------------- /ssm-classLoader/src/main/java/com/uifuture/classloader/ClassLoaderTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.classloader; 6 | 7 | /** 8 | * 用来演示类加载器的顺序 9 | * 10 | * @author chenhx 11 | * @version TestClassLoader.java, v 0.1 2018-07-17 下午 9:00 12 | */ 13 | public class ClassLoaderTest { 14 | public static void main(String[] args) { 15 | ClassLoader loader = ClassLoaderTest.class.getClassLoader(); 16 | while (loader != null) { 17 | System.err.println(loader); 18 | loader = loader.getParent(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ssm-design-pattern/README.md: -------------------------------------------------------------------------------- 1 | # ssm-design-pattern 2 | 3.X 设计模式 3 | #### com.uifuture包下介绍 4 | 3.1 单例模式(Singleton Pattern) singleton 5 | 3.1.1 懒汉式单例类 idler 6 | 3.1.2 饿汉式单例类 eager 7 | 3.2 工厂模式(Factory Pattern) factory 8 | 3.2.1 简单工厂模式(Simple Factory Pattern) simple 9 | 3.2.2 工厂方法模式(Factory Method Pattern) method 10 | 3.2.3 抽象工厂模式(Abstract Factory) abstractfactory 11 | 3.4 策略模式(Strategy Pattern) strategy 12 | 3.5 模板模式(Template Pattern) template 13 | 14 | -------------------------------------------------------------------------------- /ssm-design-pattern/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | uifuture-ssm 7 | com.uifuture 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | com.uifuture 13 | ssm-design-pattern 14 | 15 | 16 | -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/factory/abstractfactory/abstractfactory/PayFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.factory.abstractfactory.abstractfactory; 6 | 7 | import com.uifuture.factory.abstractfactory.abstractproduct.AliPay; 8 | import com.uifuture.factory.abstractfactory.abstractproduct.WxPay; 9 | 10 | /** 11 | * 抽象工厂,负责创建支付渠道,在这里是创建AliPay和WxPay 12 | * 注意是创建多个!-与工厂方法模式最大的区别 13 | * 14 | * @author chenhx 15 | * @version SystemPayFactory.java, v 0.1 2018-07-29 下午 5:19 16 | */ 17 | public interface PayFactory { 18 | /** 19 | * 创建AliPay对象 20 | * 21 | * @return 22 | */ 23 | public AliPay createAliPay(); 24 | 25 | /** 26 | * 创建WxPay对象 27 | * 28 | * @return 29 | */ 30 | public WxPay createWxPay(); 31 | } 32 | -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/factory/abstractfactory/abstractproduct/AliPay.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.factory.abstractfactory.abstractproduct; 6 | 7 | /** 8 | * 为AliPay对象声明接口 9 | * 10 | * @author chenhx 11 | * @version AliPay.java, v 0.1 2018-07-29 下午 4:52 12 | */ 13 | public interface AliPay { 14 | /** 15 | * app支付方式 16 | */ 17 | void appPay(); 18 | } 19 | -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/factory/abstractfactory/abstractproduct/WxPay.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.factory.abstractfactory.abstractproduct; 6 | 7 | /** 8 | * 为WxPay对象声明接口 9 | * 10 | * @author chenhx 11 | * @version WxPay.java, v 0.1 2018-07-29 下午 4:53 12 | */ 13 | public interface WxPay { 14 | /** 15 | * app支付方式 16 | */ 17 | void appPpay(); 18 | } 19 | -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/factory/abstractfactory/concreteproduct/AndroidAliPay.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.factory.abstractfactory.concreteproduct; 6 | 7 | import com.uifuture.factory.abstractfactory.abstractproduct.AliPay; 8 | 9 | /** 10 | * 安卓系统下的支付宝具体支付产品,由工厂负责生产的具体对象 11 | * 12 | * @author chenhx 13 | * @version AndroidAliPay.java, v 0.1 2018-07-29 下午 5:14 14 | */ 15 | public class AndroidAliPay implements AliPay { 16 | @Override 17 | public void appPay() { 18 | System.out.println("Android平台下的支付宝APP支付"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/factory/abstractfactory/concreteproduct/AndroidWxPay.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.factory.abstractfactory.concreteproduct; 6 | 7 | import com.uifuture.factory.abstractfactory.abstractproduct.WxPay; 8 | 9 | /** 10 | * 安卓系统下的微信具体支付产品,由工厂负责生产的具体对象 11 | * 12 | * @author chenhx 13 | * @version AndroidWxPay.java, v 0.1 2018-07-29 下午 5:15 14 | */ 15 | public class AndroidWxPay implements WxPay { 16 | @Override 17 | public void appPpay() { 18 | System.out.println("Android平台下的微信APP支付"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/factory/abstractfactory/concreteproduct/IOSAliPay.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.factory.abstractfactory.concreteproduct; 6 | 7 | import com.uifuture.factory.abstractfactory.abstractproduct.AliPay; 8 | 9 | /** 10 | * IOS系统下的支付宝具体支付产品,由工厂负责生产的具体对象 11 | * 12 | * @author chenhx 13 | * @version AndroidAliPay.java, v 0.1 2018-07-29 下午 5:14 14 | */ 15 | public class IOSAliPay implements AliPay { 16 | @Override 17 | public void appPay() { 18 | System.out.println("iOS平台下的支付宝APP支付"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/factory/abstractfactory/concreteproduct/IOSWxPay.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.factory.abstractfactory.concreteproduct; 6 | 7 | import com.uifuture.factory.abstractfactory.abstractproduct.WxPay; 8 | 9 | /** 10 | * IOS系统下的微信具体支付产品,由工厂负责生产的具体对象 11 | * 12 | * @author chenhx 13 | * @version AndroidWxPay.java, v 0.1 2018-07-29 下午 5:15 14 | */ 15 | public class IOSWxPay implements WxPay { 16 | @Override 17 | public void appPpay() { 18 | System.out.println("iOS平台下的微信APP支付"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/factory/method/Pay.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.factory.method; 6 | 7 | /** 8 | * 支付方式的公共父接口 9 | * 10 | * @author chenhx 11 | * @version Pay.java, v 0.1 2018-07-29 下午 2:49 12 | */ 13 | public interface Pay { 14 | /** 15 | * 支付公共接口方法 16 | */ 17 | void pay(); 18 | //另外还有退款,关闭订单,查询等等公共方法,在此不进行写了 19 | } 20 | -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/factory/method/PayFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.factory.method; 6 | 7 | /** 8 | * 公共的工厂接口 9 | * 10 | * @author chenhx 11 | * @version PayFactory.java, v 0.1 2018-07-29 下午 3:34 12 | */ 13 | public interface PayFactory { 14 | /** 15 | * 声明公共的工厂方法 16 | * 17 | * @return 18 | */ 19 | Pay getPay(); 20 | } 21 | -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/factory/method/impl/AliPayImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.factory.method.impl; 6 | 7 | import com.uifuture.factory.method.Pay; 8 | 9 | /** 10 | * 支付宝支付方式 11 | * 12 | * @author chenhx 13 | * @version AliPayImpl.java, v 0.1 2018-07-29 下午 2:50 14 | */ 15 | public class AliPayImpl implements Pay { 16 | @Override 17 | public void pay() { 18 | System.out.println("进行支付宝支付"); 19 | } 20 | } -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/factory/method/impl/AliPayImplFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.factory.method.impl; 6 | 7 | import com.uifuture.factory.method.Pay; 8 | import com.uifuture.factory.method.PayFactory; 9 | 10 | /** 11 | * AliPayImpl的具体工厂方法 12 | * 13 | * @author chenhx 14 | * @version AliPayFactory.java, v 0.1 2018-07-29 下午 3:37 15 | */ 16 | public class AliPayImplFactory implements PayFactory { 17 | /** 18 | * 返回具体的实例对象 19 | * 20 | * @return 21 | */ 22 | @Override 23 | public Pay getPay() { 24 | return new AliPayImpl(); 25 | } 26 | } -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/factory/method/impl/WxPayImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.factory.method.impl; 6 | 7 | import com.uifuture.factory.method.Pay; 8 | 9 | /** 10 | * 微信支付方式 11 | * 12 | * @author chenhx 13 | * @version WxPayImpl.java, v 0.1 2018-07-29 下午 2:51 14 | */ 15 | public class WxPayImpl implements Pay { 16 | @Override 17 | public void pay() { 18 | System.out.println("进行微信支付"); 19 | } 20 | } -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/factory/method/impl/WxPayImplFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.factory.method.impl; 6 | 7 | import com.uifuture.factory.method.Pay; 8 | import com.uifuture.factory.method.PayFactory; 9 | 10 | /** 11 | * WxPayImpl的具体工厂类 12 | * 13 | * @author chenhx 14 | * @version WxPayImplFactory.java, v 0.1 2018-07-29 下午 3:40 15 | */ 16 | public class WxPayImplFactory implements PayFactory { 17 | @Override 18 | public Pay getPay() { 19 | return new WxPayImpl(); 20 | } 21 | } -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/factory/simple/Pay.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.factory.simple; 6 | 7 | /** 8 | * 支付方式的公共父接口 9 | * 10 | * @author chenhx 11 | * @version Pay.java, v 0.1 2018-07-29 下午 2:49 12 | */ 13 | public interface Pay { 14 | /** 15 | * 支付公共接口方法 16 | */ 17 | void pay(); 18 | //另外还有退款,关闭订单,查询等等公共方法,在此不进行写了 19 | } 20 | -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/factory/simple/PayFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.factory.simple; 6 | 7 | import com.uifuture.factory.simple.impl.AliPayImpl; 8 | import com.uifuture.factory.simple.impl.WxPayImpl; 9 | 10 | /** 11 | * 支付的工厂方法 12 | * 13 | * @author chenhx 14 | * @version PayFactory.java, v 0.1 2018-07-29 下午 2:55 15 | */ 16 | public class PayFactory { 17 | /** 18 | * 通过传入参数,根据参数的不同分别返回不同的实例对象 19 | * 20 | * @param type 21 | * @return 22 | */ 23 | public static Pay getPay(String type) { 24 | Pay pay = null; 25 | if (type.equals("ali")) { 26 | pay = new AliPayImpl(); 27 | } else if (type.equals("wx")) { 28 | pay = new WxPayImpl(); 29 | } 30 | return pay; 31 | } 32 | } -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/factory/simple/TestPayFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.factory.simple; 6 | 7 | /** 8 | * 简单工厂方法的测试 9 | * 10 | * @author chenhx 11 | * @version TestPayFactory.java, v 0.1 2018-07-29 下午 3:02 12 | */ 13 | public class TestPayFactory { 14 | public static void main(String[] args) { 15 | //传入不同的type值,运行查看输出结果是否与预期的一致 16 | Pay aliPay = PayFactory.getPay("ali"); 17 | aliPay.pay(); 18 | Pay wxPay = PayFactory.getPay("wx"); 19 | wxPay.pay(); 20 | } 21 | } -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/factory/simple/impl/AliPayImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.factory.simple.impl; 6 | 7 | import com.uifuture.factory.simple.Pay; 8 | 9 | /** 10 | * 支付宝支付方式 11 | * 12 | * @author chenhx 13 | * @version AliPayImpl.java, v 0.1 2018-07-29 下午 2:50 14 | */ 15 | public class AliPayImpl implements Pay { 16 | @Override 17 | public void pay() { 18 | System.out.println("进行支付宝支付"); 19 | } 20 | } -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/factory/simple/impl/WxPayImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.factory.simple.impl; 6 | 7 | import com.uifuture.factory.simple.Pay; 8 | 9 | /** 10 | * 微信支付方式 11 | * 12 | * @author chenhx 13 | * @version WxPayImpl.java, v 0.1 2018-07-29 下午 2:51 14 | */ 15 | public class WxPayImpl implements Pay { 16 | @Override 17 | public void pay() { 18 | System.out.println("进行微信支付"); 19 | } 20 | } -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/mvc/MVCDemo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.mvc; 6 | 7 | /** 8 | * MVC设计模式演示 9 | * 10 | * @author chenhx 11 | * @version MVCDemo.java, v 0.1 2018-08-02 下午 10:20 12 | */ 13 | public class MVCDemo { 14 | public static void main(String[] args) { 15 | //获取输入的数据 16 | User user = new User(); 17 | user.setId(1); 18 | user.setUsername("chenhx"); 19 | user.setPassword("1234"); 20 | //接下来创建视图,将信息输出到控制台 21 | UserView userView = new UserView(); 22 | //下面是使用控制器,进行数据更新 23 | UserController userController = new UserController(user, userView); 24 | userController.updateView(); 25 | //再进行更新模型数据 26 | userController.setUserPassword("6666"); 27 | //更新后进行模型数据的视图展示 28 | userController.updateView(); 29 | } 30 | } -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/mvc/UserController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.mvc; 6 | 7 | /** 8 | * 控制器 9 | * 10 | * @author chenhx 11 | * @version UserController.java, v 0.1 2018-08-02 下午 10:12 12 | */ 13 | public class UserController { 14 | private User user; 15 | private UserView userView; 16 | 17 | public UserController(User user, UserView userView) { 18 | this.user = user; 19 | this.userView = userView; 20 | } 21 | 22 | /** 23 | * 更新模型数据 24 | */ 25 | public void setUserPassword(String password) { 26 | user.setPassword(password); 27 | } 28 | 29 | /** 30 | * 进行更新视图 31 | */ 32 | public void updateView() { 33 | userView.show(user); 34 | } 35 | } -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/mvc/UserView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.mvc; 6 | 7 | /** 8 | * 视图 9 | * 10 | * @author chenhx 11 | * @version UserView.java, v 0.1 2018-08-02 下午 10:10 12 | */ 13 | public class UserView { 14 | public void show(User user) { 15 | System.out.println("展示数据:" + user); 16 | } 17 | } -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/singleton/eager/EagerSingleton.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.singleton.eager; 6 | 7 | /** 8 | * 饿汉式实现方式 9 | * 10 | * @author chenhx 11 | * @version StaticThreadSafeSingleton.java, v 0.1 2018-07-29 下午 1:53 12 | */ 13 | public class EagerSingleton { 14 | /** 15 | * 静态的内部变量 16 | */ 17 | private static EagerSingleton eagerSingleton = new EagerSingleton(); 18 | 19 | /** 20 | * 将构造方法设置为私有,不让外部访问 21 | */ 22 | private EagerSingleton() { 23 | } 24 | 25 | /** 26 | * 实现一个全局可以访问的方法,通过该方法可以获取该单例对象 27 | * 28 | * @return 29 | */ 30 | public static EagerSingleton getInstance() { 31 | return eagerSingleton; 32 | } 33 | } -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/singleton/idler/StaticThreadSafeSingleton.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.singleton.idler; 6 | 7 | /** 8 | * 静态内部类懒汉式实现方式 9 | * 10 | * @author chenhx 11 | * @version StaticThreadSafeSingleton.java, v 0.1 2018-07-29 下午 1:53 12 | */ 13 | public class StaticThreadSafeSingleton { 14 | /** 15 | * 将构造方法设置为私有,不让外部访问 16 | */ 17 | private StaticThreadSafeSingleton() { 18 | } 19 | 20 | /** 21 | * 实现一个全局可以访问的方法,通过该方法可以获取该单例对象 22 | * 23 | * @return 24 | */ 25 | public static StaticThreadSafeSingleton getInstance() { 26 | return HolderClass.staticThreadSafeSingleton; 27 | } 28 | 29 | /** 30 | * 类的内部自己定义一个类,注意是私有类 31 | */ 32 | private static class HolderClass { 33 | /** 34 | * 静态内部类中定义一个私有变量,对该变量进行了单例实现 35 | */ 36 | private final static StaticThreadSafeSingleton staticThreadSafeSingleton = new StaticThreadSafeSingleton(); 37 | } 38 | } -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/singleton/idler/ThreadSafeSingleton.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.singleton.idler; 6 | 7 | /** 8 | * 线程安全的懒汉式实现方式 9 | * 10 | * @author chenhx 11 | * @version ThreadUnsafeSingleton.java, v 0.1 2018-07-29 下午 13:10 12 | */ 13 | public class ThreadSafeSingleton { 14 | /** 15 | * 类的内部自己定义一个对象,注意是私有对象 16 | */ 17 | private static ThreadSafeSingleton threadSafeSingleton; 18 | 19 | /** 20 | * 将构造方法设置为私有,不让外部访问 21 | */ 22 | private ThreadSafeSingleton() { 23 | } 24 | 25 | /** 26 | * 接下来依旧实现一个全局可以访问的方法,通过该方法可以获取该单例对象 27 | * 但是在该方法上我们进行加锁 28 | * 29 | * @return 30 | */ 31 | public static synchronized ThreadSafeSingleton getInstance() { 32 | if (threadSafeSingleton == null) { 33 | threadSafeSingleton = new ThreadSafeSingleton(); 34 | } 35 | return threadSafeSingleton; 36 | } 37 | } -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/singleton/idler/ThreadUnsafeSingleton.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.singleton.idler; 6 | 7 | /** 8 | * 线程不安全的懒汉式实现方式 9 | * 10 | * @author chenhx 11 | * @version ThreadUnsafeSingleton.java, v 0.1 2018-07-29 下午 12:52 12 | */ 13 | public class ThreadUnsafeSingleton { 14 | /** 15 | * 类的内部自己定义一个对象,注意是私有对象 16 | */ 17 | private static ThreadUnsafeSingleton threadUnsafeSingleton; 18 | 19 | /** 20 | * 将构造方法设置为私有,不让外部访问 21 | */ 22 | private ThreadUnsafeSingleton() { 23 | } 24 | 25 | /** 26 | * 接下来就是实现一个全局可以访问的方法,通过该方法可以获取该单例对象 27 | * 28 | * @return 29 | */ 30 | public static ThreadUnsafeSingleton getInstance() { 31 | if (threadUnsafeSingleton == null) { 32 | threadUnsafeSingleton = new ThreadUnsafeSingleton(); 33 | } 34 | return threadUnsafeSingleton; 35 | } 36 | } -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/strategy/Strategy.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.strategy; 6 | 7 | import java.math.BigDecimal; 8 | 9 | /** 10 | * 抽象策略角色 11 | * 12 | * @author chenhx 13 | * @version Strategy.java, v 0.1 2018-07-30 下午 10:08 14 | */ 15 | public abstract class Strategy { 16 | /** 17 | * 打折活动 18 | * 19 | * @param price 实际价格 20 | * @return 通过打折后返回的不同价格 21 | */ 22 | public abstract BigDecimal discount(BigDecimal price); 23 | } 24 | -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/strategy/impl/EveningStrategyImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.strategy.impl; 6 | 7 | import com.uifuture.strategy.Strategy; 8 | 9 | import java.math.BigDecimal; 10 | 11 | /** 12 | * 晚上时间段具体的打折策略角色 13 | * 14 | * @author chenhx 15 | * @version EveningStrategyImpl.java, v 0.1 2018-07-31 下午 7:27 16 | */ 17 | public class EveningStrategyImpl extends Strategy { 18 | /** 19 | * 晚上进行促销打折活动 20 | * 21 | * @param price 实际价格 22 | * @return 23 | */ 24 | @Override 25 | public BigDecimal discount(BigDecimal price) { 26 | System.out.println("实际价格:" + price.doubleValue()); 27 | //直接返回折扣的金额 28 | return price.multiply(new BigDecimal(0.5)); 29 | } 30 | } -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/strategy/impl/MorningStrategyImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.strategy.impl; 6 | 7 | import com.uifuture.strategy.Strategy; 8 | 9 | import java.math.BigDecimal; 10 | 11 | /** 12 | * 早上时间段具体的打折策略角色 13 | * 14 | * @author chenhx 15 | * @version MorningStrategyImpl.java, v 0.1 2018-07-30 下午 10:12 16 | */ 17 | public class MorningStrategyImpl extends Strategy { 18 | /** 19 | * 在实际应用中,可能还会有另外的一系列操作 20 | * @param price 实际价格 21 | * @return 22 | */ 23 | @Override 24 | public BigDecimal discount(BigDecimal price) { 25 | System.out.println("实际价格:" + price.doubleValue()); 26 | //直接返回折扣的金额 27 | return price.multiply(new BigDecimal(0.8)); 28 | } 29 | } -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/strategy/impl/NooningStrategyImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.strategy.impl; 6 | 7 | import com.uifuture.strategy.Strategy; 8 | 9 | import java.math.BigDecimal; 10 | 11 | /** 12 | * 中午时间段具体的打折策略角色 13 | * 14 | * @author chenhx 15 | * @version NooningStrategyImpl.java, v 0.1 2018-07-31 下午 6:18 16 | */ 17 | public class NooningStrategyImpl extends Strategy { 18 | /** 19 | * 进行促销打折活动 20 | * 21 | * @param price 实际价格 22 | * @return 23 | */ 24 | @Override 25 | public BigDecimal discount(BigDecimal price) { 26 | System.out.println("实际价格:" + price.doubleValue()); 27 | //直接返回折扣的金额 28 | return price.multiply(new BigDecimal(0.6)); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/template/TestClient.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.template; 6 | 7 | import com.uifuture.template.impl.BlackTeaImpl; 8 | import com.uifuture.template.impl.GreenTeaImpl; 9 | 10 | /** 11 | * 测试客户端类 12 | * 13 | * @author chenhx 14 | * @version TestClient.java, v 0.1 2018-08-01 下午 10:11 15 | */ 16 | public class TestClient { 17 | public static void main(String[] args) { 18 | AbstractTemplateRole templateRole = new GreenTeaImpl(); 19 | templateRole.drinkTea(); 20 | System.out.println("============"); 21 | //接下来进行调用另外一种方式 22 | templateRole = new BlackTeaImpl(); 23 | templateRole.drinkTea(); 24 | } 25 | } -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/template/impl/BlackTeaImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.template.impl; 6 | 7 | import com.uifuture.template.AbstractTemplateRole; 8 | 9 | /** 10 | * 具体模板实现类 11 | * 12 | * @author chenhx 13 | * @version GreenTeaImpl.java, v 0.1 2018-08-01 下午 10:05 14 | */ 15 | public class BlackTeaImpl extends AbstractTemplateRole { 16 | /** 17 | * 进行选择烧火方式 18 | */ 19 | @Override 20 | protected void boil() { 21 | System.out.println("使用电烧水..."); 22 | } 23 | 24 | /** 25 | * 选择茶叶和杯子 26 | */ 27 | @Override 28 | protected void makeTea() { 29 | System.out.println("使用方杯泡红茶"); 30 | } 31 | 32 | /** 33 | * 加点配料进去 34 | */ 35 | @Override 36 | protected void burdening() { 37 | System.out.println("放点糖进去"); 38 | } 39 | } -------------------------------------------------------------------------------- /ssm-design-pattern/src/main/java/com/uifuture/template/impl/GreenTeaImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.template.impl; 6 | 7 | import com.uifuture.template.AbstractTemplateRole; 8 | 9 | /** 10 | * 具体模板实现类 11 | * 12 | * @author chenhx 13 | * @version GreenTeaImpl.java, v 0.1 2018-08-01 下午 10:05 14 | */ 15 | public class GreenTeaImpl extends AbstractTemplateRole { 16 | /** 17 | * 进行选择烧火方式 18 | */ 19 | @Override 20 | protected void boil() { 21 | System.out.println("使用柴火烧水..."); 22 | } 23 | 24 | /** 25 | * 选择茶叶和杯子 26 | */ 27 | @Override 28 | protected void makeTea() { 29 | System.out.println("使用圆杯泡绿茶"); 30 | } 31 | } -------------------------------------------------------------------------------- /ssm-mq-aliyun/README.md: -------------------------------------------------------------------------------- 1 | # ssm-mq 2 | 3 | ## 项目介绍 4 | 5 | 快速接入阿里云MQ 6 | 7 | ## Spring集成 8 | 9 | 引入依赖: 10 | 11 | ```xml 12 | 13 | 14 | com.uifuture 15 | ssm-mq-aliyun 16 | 1.0-SNAPSHOT 17 | 18 | ``` 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /ssm-mq-aliyun/src/main/java/com/uifuture/ssm/mq/aliyun/ConsumeResult.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mq.aliyun; 2 | 3 | public enum ConsumeResult { 4 | /** 5 | * 消费成功,继续消费下一条消息 6 | */ 7 | CommitMessage("CommitMessage", "消费成功,继续消费下一条消息"), 8 | /** 9 | * 消费失败,告知服务器稍后再投递这条消息,继续消费其他消息 10 | */ 11 | ReconsumeLater("ReconsumeLater", "消费失败,告知服务器稍后再投递这条消息,继续消费其他消息"); 12 | 13 | private String code; 14 | private String desc; 15 | 16 | private ConsumeResult(String code, String desc) { 17 | this.code = code; 18 | this.desc = desc; 19 | } 20 | 21 | public String getCode() { 22 | return code; 23 | } 24 | 25 | public String getDesc() { 26 | return desc; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ssm-mq-aliyun/src/main/java/com/uifuture/ssm/mq/aliyun/MQConsumer.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mq.aliyun; 2 | 3 | import java.util.Map; 4 | 5 | /** 6 | * 消费者,接收消息 7 | * 发送方全部采取将Map转成fastJson发送 8 | */ 9 | public interface MQConsumer { 10 | 11 | /** 12 | * 消息的内容 13 | * 14 | * @param body 15 | * @return 16 | */ 17 | ConsumeResult onRecived(Map body); 18 | } 19 | -------------------------------------------------------------------------------- /ssm-mq-aliyun/src/main/java/com/uifuture/ssm/mq/aliyun/ons/ComsumeResultAdapter.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mq.aliyun.ons; 2 | 3 | import com.aliyun.openservices.ons.api.Action; 4 | import com.uifuture.ssm.mq.aliyun.ConsumeResult; 5 | 6 | /** 7 | * 阿里云的返回状态与自定义的转换器 8 | */ 9 | public class ComsumeResultAdapter { 10 | public static Action getResult(ConsumeResult result) { 11 | if (result == null) { 12 | return Action.CommitMessage; 13 | } 14 | if (result.getCode().equals(ConsumeResult.CommitMessage.getCode())) { 15 | return Action.CommitMessage; 16 | } 17 | if (result.getCode().equals(ConsumeResult.ReconsumeLater.getCode())) { 18 | return Action.ReconsumeLater; 19 | } 20 | return Action.CommitMessage; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ssm-mq-aliyun/src/main/java/com/uifuture/ssm/mq/aliyun/ons/ONSCustomerConnConfig.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mq.aliyun.ons; 2 | 3 | 4 | import java.util.Map; 5 | 6 | /** 7 | * 消费者 阿里云配置属性 8 | */ 9 | public class ONSCustomerConnConfig { 10 | private String accessKey = ""; 11 | private String secretKey = ""; 12 | private Map userConfig; 13 | 14 | public String getAccessKey() { 15 | return accessKey; 16 | } 17 | 18 | public void setAccessKey(String accessKey) { 19 | this.accessKey = accessKey; 20 | } 21 | 22 | public String getSecretKey() { 23 | return secretKey; 24 | } 25 | 26 | public void setSecretKey(String secretKey) { 27 | this.secretKey = secretKey; 28 | } 29 | 30 | public Map getUserConfig() { 31 | return userConfig; 32 | } 33 | 34 | public void setUserConfig(Map userConfig) { 35 | this.userConfig = userConfig; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ssm-mybatis-generator/src/main/java/com/uifuture/GeneratorMain2.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture; 6 | 7 | import org.mybatis.generator.api.ShellRunner; 8 | 9 | /** 10 | * generator使用Java方式运行 11 | * 运行方法二 ShellRunner方式运行 12 | * 13 | * @author chenhx 14 | * @version GeneratorMain2.java, v 0.1 2018-12-04 下午 7:13 chenhx 15 | */ 16 | public class GeneratorMain2 { 17 | public static void main(String[] args) { 18 | args = new String[]{"-configfile", "ssm-mybatis-generator\\src\\main\\resources\\generatorConfig.xml", "-overwrite"}; 19 | ShellRunner.main(args); 20 | } 21 | } -------------------------------------------------------------------------------- /ssm-mybatis-generator/src/main/resources/generator.properties: -------------------------------------------------------------------------------- 1 | jdbc.driverLocation=C:\\Users\\Administrator\\.m2\\repository\\mysql\\mysql-connector-java\\5.1.46\\mysql-connector-java-5.1.46.jar 2 | jdbc.driverClass=com.mysql.jdbc.Driver 3 | # useSSL=false&serverTimezone=GMT在mysql高版本下需要 4 | # remarks=true 5 | jdbc.connectionURL=jdbc:mysql://localhost:3306/chapter-10-ssm?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT&remarks=true 6 | jdbc.userId=root 7 | jdbc.password=1234 8 | model.package=com.uifuture.entity 9 | mapper.xml.package=com.uifuture.mapper 10 | mapper.impl.package=com.uifuture.dao 11 | # main方法运行插件路径不需要返回上层路径 12 | model.project=ssm-mybatis-generator/src/main/java 13 | mapper.xml.project=ssm-mybatis-generator/src/main/java 14 | mapper.impl.project=ssm-mybatis-generator/src/main/java 15 | 16 | # 使用maven插件运行需要有../ 17 | #model.project=../ssm-mybatis-generator/src/main/java 18 | #mapper.xml.project=../ssm-mybatis-generator/src/main/java 19 | #mapper.impl.project=../ssm-mybatis-generator/src/main/java 20 | 21 | 22 | -------------------------------------------------------------------------------- /ssm-mybatis-transaction/src/main/java/com/uifuture/chapter17/domain/base/BaseEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.chapter17.domain.base; 6 | 7 | import lombok.Data; 8 | 9 | import java.util.Date; 10 | 11 | /** 12 | * 数据库实体基类 13 | * 14 | * @author chenhx 15 | * @version BaseEntity.java, v 0.1 2019-08-23 00:12 chenhx 16 | */ 17 | @Data 18 | public class BaseEntity { 19 | public static final String ID = "id"; 20 | public static final String CREATE_TIME = "create_time"; 21 | public static final String UPDATE_TIME = "update_time"; 22 | public static final String DELETE_TIME = "delete_time"; 23 | /** 24 | * id 25 | */ 26 | private Integer id; 27 | /** 28 | * 创建时间 29 | */ 30 | private Date createTime; 31 | /** 32 | * 修改时间 33 | */ 34 | private Date updateTime; 35 | /** 36 | * 删除时间 37 | */ 38 | private Long deleteTime; 39 | } 40 | -------------------------------------------------------------------------------- /ssm-mybatis-transaction/src/main/java/com/uifuture/chapter17/domain/entity/UsersEntity.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.chapter17.domain.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.uifuture.chapter17.domain.base.BaseEntity; 5 | import lombok.Data; 6 | import lombok.EqualsAndHashCode; 7 | import lombok.experimental.Accessors; 8 | 9 | /** 10 | *

11 | * 12 | *

13 | * 14 | * @author chenhx 15 | * @since 2019-08-23 16 | */ 17 | @Data 18 | @EqualsAndHashCode(callSuper = true) 19 | @Accessors(chain = true) 20 | @TableName("users") 21 | public class UsersEntity extends BaseEntity { 22 | 23 | public static final String USERNAME = "username"; 24 | public static final String MONEY = "money"; 25 | private static final long serialVersionUID = 1L; 26 | /** 27 | * 用户名 28 | */ 29 | private String username; 30 | /** 31 | * 金额,单位:分 32 | */ 33 | private Integer money; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /ssm-mybatis-transaction/src/main/java/com/uifuture/chapter17/mapper/UsersMapper.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.chapter17.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.uifuture.chapter17.domain.entity.UsersEntity; 5 | 6 | /** 7 | *

8 | * Mapper 接口 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-08-23 13 | */ 14 | public interface UsersMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-mybatis-transaction/src/main/java/com/uifuture/chapter17/mapper/xml/UsersMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ssm-mybatis-transaction/src/main/java/com/uifuture/chapter17/service/IUsersService.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.chapter17.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.uifuture.chapter17.domain.entity.UsersEntity; 5 | 6 | /** 7 | *

8 | * 服务类 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-08-23 13 | */ 14 | public interface IUsersService extends IService { 15 | /** 16 | * 通过用户名修改用户 17 | * 18 | * @param usersEntity 19 | * @return 20 | */ 21 | Boolean updateByUsername(UsersEntity usersEntity); 22 | 23 | /** 24 | * 通过用户名修改金额 25 | * 26 | * @param money 27 | * @param username 28 | * @return 29 | */ 30 | Boolean updateMoneyByUsername(Integer money, String username); 31 | 32 | /** 33 | * 转账接口 34 | * 35 | * @param fromName 转账方 36 | * @param toName 收账方 37 | * @param money 金额 38 | */ 39 | void transfer(String fromName, String toName, Integer money); 40 | } 41 | -------------------------------------------------------------------------------- /ssm-mybatis-transaction/src/main/resources/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ssm-mybatis-transaction/src/main/resources/jdbc.properties: -------------------------------------------------------------------------------- 1 | driver=com.mysql.jdbc.Driver 2 | url=jdbc:mysql://localhost:3306/ssm_test?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull 3 | username=root 4 | password=12345678 5 | -------------------------------------------------------------------------------- /ssm-mybatis-transaction/src/main/resources/sql/users.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `users` ( 2 | `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id', 3 | `username` varchar(32) NOT NULL COMMENT '用户名', 4 | `money` int(22) NOT NULL DEFAULT '0' COMMENT '金额,单位:分 ', 5 | `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', 6 | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', 7 | `delete_time` int(22) NOT NULL DEFAULT '0' COMMENT '删除时间,0-未删除 ', 8 | PRIMARY KEY (`id`), 9 | UNIQUE KEY `uniq_username` (`username`) USING BTREE COMMENT '用户名唯一建' 10 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; 11 | 12 | INSERT INTO `ssm_test`.`users` (`username`, `money`, `create_time`, `update_time`, `delete_time`) VALUES ('a', 100000, DEFAULT, DEFAULT, DEFAULT); 13 | INSERT INTO `ssm_test`.`users` (`username`, `money`, `create_time`, `update_time`, `delete_time`) VALUES ('b', 100000, DEFAULT, DEFAULT, DEFAULT); 14 | -------------------------------------------------------------------------------- /ssm-mybatis-transaction/src/test/java/com/uifuture/chapter17/BaseTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.chapter17; 6 | 7 | import org.junit.runner.RunWith; 8 | import org.springframework.test.context.ContextConfiguration; 9 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 10 | import org.springframework.test.context.web.WebAppConfiguration; 11 | 12 | /** 13 | * 测试基类 14 | * @author chenhx 15 | * @version BaseTest.java, v 0.1 2019-08-23 00:53 chenhx 16 | */ 17 | @RunWith(SpringJUnit4ClassRunner.class) 18 | @WebAppConfiguration 19 | @ContextConfiguration({"classpath*:applicationContext.xml"}) 20 | public class BaseTest { 21 | } 22 | -------------------------------------------------------------------------------- /ssm-mybatis-xml-config/README.md: -------------------------------------------------------------------------------- 1 | # uifuture-ssm 2 | 3 | #### 项目介绍 4 | SSM书籍配套项目 5 | 6 | #### chapter-10-mybatis-xml-config 7 | 对应的章节: 8 | 第10章 9 | 第11章 10 | 11 | 12 | #### 参与贡献 13 | -------------------------------------------------------------------------------- /ssm-mybatis-xml-config/src/main/java/com/uifuture/chapter12/dao/PostMapper.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.chapter12.dao; 2 | 3 | 4 | import com.uifuture.chapter12.entity.Post; 5 | import org.apache.ibatis.annotations.Select; 6 | 7 | import java.util.List; 8 | 9 | public interface PostMapper { 10 | @Select("SELECT * FROM post") 11 | List selectAll(); 12 | } -------------------------------------------------------------------------------- /ssm-mybatis-xml-config/src/main/java/com/uifuture/chapter12/entity/BlogExt.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.chapter12.entity; 2 | 3 | import java.util.List; 4 | 5 | 6 | public class BlogExt extends Blog { 7 | private List posts; 8 | 9 | /** 10 | * Getter method for property posts. 11 | * 12 | * @return property value of posts 13 | */ 14 | public List getPosts() { 15 | return posts; 16 | } 17 | 18 | /** 19 | * Setter method for property posts. 20 | * 21 | * @param posts value to be assigned to property posts 22 | */ 23 | public void setPosts(List posts) { 24 | this.posts = posts; 25 | } 26 | 27 | @Override 28 | public String toString() { 29 | final StringBuilder sb = new StringBuilder("BlogExt{"); 30 | sb.append(super.toString()); 31 | sb.append(","); 32 | sb.append("posts=").append(posts); 33 | sb.append('}'); 34 | return sb.toString(); 35 | } 36 | } -------------------------------------------------------------------------------- /ssm-mybatis-xml-config/src/main/java/com/uifuture/chapter12/mapper/PostMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | id, subject, body, blog_id 12 | 13 | 14 | -------------------------------------------------------------------------------- /ssm-mybatis-xml-config/src/main/resources/jdbc.properties: -------------------------------------------------------------------------------- 1 | driver=com.mysql.jdbc.Driver 2 | url=jdbc:mysql://localhost:3306/chapter-10-ssm?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull 3 | 4 | -------------------------------------------------------------------------------- /ssm-proxy/README.md: -------------------------------------------------------------------------------- 1 | # ssm-proxy 2 | 2.3 动态代理 3 | 4 | #### com.uifuture下包介绍 5 | 2.3.2 JDK动态代理 dynamicproxy.jdk 6 | 2.3.3 CGLIB动态代理简介 dynamicproxy.cglib CGLIB动态代理 7 | dynamicproxy.staticproxy 静态代理 -------------------------------------------------------------------------------- /ssm-proxy/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | uifuture-ssm 7 | com.uifuture 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | ssm-proxy 13 | 14 | 15 | cglib 16 | cglib 17 | 3.1 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /ssm-proxy/src/main/java/com/uifuture/dynamicproxy/cglib/AliPay.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.dynamicproxy.cglib; 6 | 7 | /** 8 | * 目标类 9 | * 10 | * @author chenhx 11 | * @version AliPay.java, v 0.1 2018-07-27 下午 6:57 12 | */ 13 | public class AliPay { 14 | public void pay(String operation) { 15 | System.out.println("进行AliPay支付,操作:" + operation); 16 | } 17 | } -------------------------------------------------------------------------------- /ssm-proxy/src/main/java/com/uifuture/dynamicproxy/cglib/TestProxy.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.dynamicproxy.cglib; 6 | 7 | /** 8 | * 进行cglib代理的测试 9 | * 10 | * @author chenhx 11 | * @version TestProxy.java, v 0.1 2018-07-27 下午 7:12 12 | */ 13 | public class TestProxy { 14 | public static void main(String[] args) { 15 | PayProxy payProxy = new PayProxy(); 16 | AliPay aliPay = payProxy.getInstance(AliPay.class); 17 | aliPay.pay("测试cglib动态代理"); 18 | } 19 | } -------------------------------------------------------------------------------- /ssm-proxy/src/main/java/com/uifuture/dynamicproxy/jdk/StoreOptimize.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.dynamicproxy.jdk; 6 | 7 | import com.uifuture.dynamicproxy.jdk.target.AliPay; 8 | import com.uifuture.dynamicproxy.jdk.target.Pay; 9 | 10 | /** 11 | * 进行调用优化后的代理类 12 | * @author chenhx 13 | * @version StoreOptimize.java, v 0.1 2018-07-24 下午 9:53 14 | */ 15 | public class StoreOptimize { 16 | public static void main(String[] args) { 17 | Pay realPay = new AliPay(); 18 | Pay aliPay = new PayProxyOptimize().create(Pay.class, realPay); 19 | aliPay.pay("测试"); 20 | Pay aliPay2 = new PayProxyOptimize().create2(Pay.class, realPay, 21 | realPay.getClass().getInterfaces() 22 | ); 23 | aliPay2.pay("测试2"); 24 | } 25 | } -------------------------------------------------------------------------------- /ssm-proxy/src/main/java/com/uifuture/dynamicproxy/jdk/target/AliPay.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.dynamicproxy.jdk.target; 6 | 7 | 8 | /** 9 | * 委托类 - 一种支付方式 10 | * 11 | * @author chenhx 12 | * @version Alipay.java, v 0.1 2018-07-24 下午 8:55 13 | */ 14 | public class AliPay implements Pay { 15 | @Override 16 | public void pay(String operation) { 17 | System.out.println("进行AliPay支付,操作:" + operation); 18 | } 19 | } -------------------------------------------------------------------------------- /ssm-proxy/src/main/java/com/uifuture/dynamicproxy/jdk/target/Pay.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.dynamicproxy.jdk.target; 6 | 7 | /** 8 | * 接口 支付的通用接口方法 9 | * 10 | * @author chenhx 11 | * @version Pay.java, v 0.1 2018-07-24 下午 8:50 12 | */ 13 | public interface Pay { 14 | void pay(String operation); 15 | } 16 | -------------------------------------------------------------------------------- /ssm-proxy/src/main/java/com/uifuture/dynamicproxy/jdk/target/WxPay.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.dynamicproxy.jdk.target; 6 | 7 | /** 8 | * 委托类 - 另一种支付方式 9 | * 10 | * @author chenhx 11 | * @version WxPay.java, v 0.1 2018-07-24 下午 8:56 12 | */ 13 | public class WxPay implements Pay { 14 | @Override 15 | public void pay(String operation) { 16 | System.out.println("进行WxPay支付,操作:" + operation); 17 | } 18 | } -------------------------------------------------------------------------------- /ssm-proxy/src/main/java/com/uifuture/staticproxy/PayProxy.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.staticproxy; 6 | 7 | import com.uifuture.staticproxy.target.AliPay; 8 | import com.uifuture.staticproxy.target.Pay; 9 | 10 | /** 11 | * 代理类 12 | * 13 | * @author chenhx 14 | * @version ProxyPay.java, v 0.1 2018-07-24 下午 8:20 15 | */ 16 | public class PayProxy implements Pay { 17 | private Pay pay; 18 | 19 | public PayProxy() { 20 | //帮助消费者进行一些操作 21 | pay = new AliPay(); 22 | } 23 | 24 | public PayProxy(AliPay aliPay) { 25 | //当然,可以直接将支付传过来,这样就可以使用消费者自己的 26 | this.pay = aliPay; 27 | } 28 | 29 | @Override 30 | public void pay(String operation) { 31 | System.out.println("代理前..."); 32 | pay.pay(operation); 33 | System.out.println("代理后..."); 34 | } 35 | } -------------------------------------------------------------------------------- /ssm-proxy/src/main/java/com/uifuture/staticproxy/Store.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.staticproxy; 6 | 7 | import com.uifuture.staticproxy.target.AliPay; 8 | 9 | /** 10 | * 消费者 11 | * 12 | * @author chenhx 13 | * @version Store.java, v 0.1 2018-07-24 下午 8:24 14 | */ 15 | public class Store { 16 | public static void main(String[] args) { 17 | PayProxy payProxy = new PayProxy(); 18 | payProxy.pay("proxy"); 19 | System.out.println("-----------------"); 20 | PayProxy payProxy2 = new PayProxy(new AliPay()); 21 | payProxy2.pay("store"); 22 | } 23 | } -------------------------------------------------------------------------------- /ssm-proxy/src/main/java/com/uifuture/staticproxy/target/AliPay.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.staticproxy.target; 6 | 7 | /** 8 | * 委托类 9 | * @author chenhx 10 | * @version Alipay.java, v 0.1 2018-07-24 下午 8:19 11 | */ 12 | public class AliPay implements Pay { 13 | @Override 14 | public void pay(String operation) { 15 | System.out.println("进行支付,操作:" + operation); 16 | } 17 | } -------------------------------------------------------------------------------- /ssm-proxy/src/main/java/com/uifuture/staticproxy/target/Pay.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.staticproxy.target; 6 | 7 | /** 8 | * 接口 支付的通用接口方法 9 | * 10 | * @author chenhx 11 | * @version Pay.java, v 0.1 2018-07-24 下午 8:19 12 | */ 13 | public interface Pay { 14 | void pay(String operation); 15 | } 16 | -------------------------------------------------------------------------------- /ssm-reflection-demo/README.md: -------------------------------------------------------------------------------- 1 | # ssm-reflection-demo 2 | 2.2 类反射 3 | 4 | #### com.uifuture包下介绍 5 | 2.2.2 类反射入门实例 hellword 6 | 2.2.3 通过类反射实现工厂方法 factorydemo 7 | 2.2.5 反射的应用场景与优缺点 classdemo 8 | Bean工具类等演示 -------------------------------------------------------------------------------- /ssm-reflection-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | uifuture-ssm 7 | com.uifuture 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | ssm-reflection-demo 13 | 14 | 15 | -------------------------------------------------------------------------------- /ssm-reflection-demo/src/main/java/com/uifuture/classdemo/ClassDemo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.classdemo; 6 | 7 | import com.uifuture.helloword.entity.Person; 8 | 9 | /** 10 | * 演示new同一个类,类对象的class也是相同的 11 | * 12 | * @author chenhx 13 | * @version ClassDemo.java, v 0.1 2018-07-21 下午 5:28 14 | */ 15 | public class ClassDemo { 16 | public static void main(String[] args) throws ClassNotFoundException { 17 | Person person = new Person(); 18 | Person person1 = new Person(); 19 | System.out.println(person == person1); 20 | System.out.println(person.getClass() == person1.getClass()); 21 | System.out.println(Person.class == Person.class); 22 | System.out.println(Class.forName("com.uifuture.helloword.entity.Person") == 23 | Class.forName("com.uifuture.helloword.entity.Person")); 24 | } 25 | } -------------------------------------------------------------------------------- /ssm-reflection-demo/src/main/java/com/uifuture/classdemo/GetClassExampleOne.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.classdemo; 6 | 7 | /** 8 | * 第一种方式:通过对象的getClass方法进行获取。这种方式需要具体的类和该类的对象,以及调用getClass方法。 9 | * 10 | * @author chenhx 11 | * @version GetClassExampleOne.java, v 0.1 2018-07-21 下午 4:34 12 | */ 13 | public class GetClassExampleOne { 14 | public static void main(String[] args) { 15 | //通过对象 16 | Class aClass = new String("test").getClass(); 17 | //输出class的全限定名 18 | System.out.println(aClass); 19 | } 20 | } -------------------------------------------------------------------------------- /ssm-reflection-demo/src/main/java/com/uifuture/classdemo/GetClassExampleThree.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.classdemo; 6 | 7 | /** 8 | * 通过Class.forName()方法获取。这种方式仅需使用类名,就可以获取该类的Class对象,更有利于扩展。也是在一些开源工具项目中常见的用法。 9 | * 10 | * @author chenhx 11 | * @version GetClassExampleOne.java, v 0.1 2018-07-21 下午 4:34 12 | */ 13 | public class GetClassExampleThree { 14 | public static void main(String[] args) throws ClassNotFoundException { 15 | //通过对象 16 | Class aClass = Class.forName("java.lang.String"); 17 | //输出class的全限定名 18 | System.out.println(aClass); 19 | } 20 | } -------------------------------------------------------------------------------- /ssm-reflection-demo/src/main/java/com/uifuture/classdemo/GetClassExampleTwo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.classdemo; 6 | 7 | /** 8 | * 第二种方式:任何数据类都具有着一个静态的属性class,通过该属性直接获取到该类型对应的Class对象。 9 | * 这种方式需要使用到具体的类,然后调用类中的静态属性class完成,不需要进行调用方法,性能比第一种方式要好一些。 10 | * 11 | * @author chenhx 12 | * @version GetClassExampleOne.java, v 0.1 2018-07-21 下午 4:34 13 | */ 14 | public class GetClassExampleTwo { 15 | public static void main(String[] args) { 16 | //通过对象 17 | Class aClass = String.class; 18 | //输出class的全限定名 19 | System.out.println(aClass); 20 | System.out.println(Integer.TYPE); 21 | 22 | } 23 | } -------------------------------------------------------------------------------- /ssm-reflection-demo/src/main/java/com/uifuture/classdemo/Users.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.classdemo; 6 | 7 | import lombok.Data; 8 | 9 | import java.util.Date; 10 | 11 | /** 12 | * 测试用的实体类 13 | * 14 | * @author chenhx 15 | * @version Users.java, v 0.1 2018-07-23 下午 9:23 16 | */ 17 | @Data 18 | public class Users { 19 | private String name; 20 | private Integer age; 21 | private String address; 22 | private Date createTime; 23 | } -------------------------------------------------------------------------------- /ssm-reflection-demo/src/main/java/com/uifuture/factorydemo/TestFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.factorydemo; 6 | 7 | import com.uifuture.factorydemo.api.Worker; 8 | import com.uifuture.factorydemo.factory.WorkerFactory; 9 | 10 | /** 11 | * 测试类 12 | * 13 | * @author chenhx 14 | * @version TestFactory.java, v 0.1 2018-07-19 下午 10:55 15 | */ 16 | public class TestFactory { 17 | public static void main(String[] args) { 18 | Worker worker = WorkerFactory.getWorker(); 19 | worker.work(); 20 | } 21 | } -------------------------------------------------------------------------------- /ssm-reflection-demo/src/main/java/com/uifuture/factorydemo/api/Worker.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.factorydemo.api; 6 | 7 | /** 8 | * 定义一个接口 9 | * 10 | * @author chenhx 11 | * @version Worker.java, v 0.1 2018-07-19 下午 10:47 12 | */ 13 | public interface Worker { 14 | /** 15 | * 定义一个接口方法 16 | */ 17 | void work(); 18 | } 19 | -------------------------------------------------------------------------------- /ssm-reflection-demo/src/main/java/com/uifuture/factorydemo/impl/WorkerOneImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.factorydemo.impl; 6 | 7 | import com.uifuture.factorydemo.api.Worker; 8 | 9 | /** 10 | * 实现类一 11 | * 12 | * @author chenhx 13 | * @version WorkerOneImpl.java, v 0.1 2018-07-19 下午 10:48 14 | */ 15 | public class WorkerOneImpl implements Worker { 16 | @Override 17 | public void work() { 18 | //输出信息方便在控制台识别实际运行的类 19 | System.out.println("WorkerOneImpl..."); 20 | } 21 | } -------------------------------------------------------------------------------- /ssm-reflection-demo/src/main/java/com/uifuture/factorydemo/impl/WorkerTwoImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.factorydemo.impl; 6 | 7 | import com.uifuture.factorydemo.api.Worker; 8 | 9 | /** 10 | * 实现类二 11 | * 12 | * @author chenhx 13 | * @version WorkerOneImpl.java, v 0.1 2018-07-19 下午 10:50 14 | */ 15 | public class WorkerTwoImpl implements Worker { 16 | @Override 17 | public void work() { 18 | System.out.println("WorkerTwoImpl..."); 19 | } 20 | } -------------------------------------------------------------------------------- /ssm-reflection-demo/src/main/resources/worker.properties: -------------------------------------------------------------------------------- 1 | # name = com.uifuture.factorydemo.impl.WorkerOneImpl 2 | name=com.uifuture.factorydemo.impl.WorkerTwoImpl -------------------------------------------------------------------------------- /ssm-spring-aop/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | uifuture-ssm 7 | com.uifuture 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | ssm-spring-aop 13 | 1.0-SNAPSHOT 14 | 15 | 16 | -------------------------------------------------------------------------------- /ssm-spring-aop/src/main/java/com/uifuture/spring/aop/annotation/RentingService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.spring.aop.annotation; 6 | 7 | /** 8 | * @author chenhx 9 | * @version RentingService.java, v 0.1 2019-07-24 20:45 chenhx 10 | */ 11 | public interface RentingService { 12 | /** 13 | * 房东的核心业务功能 14 | */ 15 | void service(); 16 | } 17 | -------------------------------------------------------------------------------- /ssm-spring-aop/src/main/java/com/uifuture/spring/aop/annotation/aspect/RentingAspect.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.spring.aop.annotation.aspect; 6 | 7 | import org.aspectj.lang.annotation.After; 8 | import org.aspectj.lang.annotation.Before; 9 | 10 | /** 11 | * 中介所需要做的事情 12 | * 代码清单16-19 13 | * 14 | * @author chenhx 15 | * @version RentingAspect.java, v 0.1 2019-07-24 20:55 chenhx 16 | */ 17 | //@Component 18 | //@Aspect 19 | public class RentingAspect { 20 | 21 | @Before("execution(* com.uifuture.spring.aop.annotation.impl.RentingServiceImpl.service())") 22 | public void before() { 23 | System.out.println("带租客看房"); 24 | System.out.println("谈价格"); 25 | } 26 | 27 | @After("execution(* com.uifuture.spring.aop.annotation.impl.RentingServiceImpl.service())") 28 | public void after() { 29 | System.out.println("交钥匙"); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /ssm-spring-aop/src/main/java/com/uifuture/spring/aop/annotation/impl/RentingServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.spring.aop.annotation.impl; 6 | 7 | import com.uifuture.spring.aop.annotation.RentingService; 8 | import org.springframework.stereotype.Service; 9 | 10 | /** 11 | * @author chenhx 12 | * @version RentingServiceImpl.java, v 0.1 2019-07-24 20:45 chenhx 13 | */ 14 | @Service("rentingServiceImpl") 15 | public class RentingServiceImpl implements RentingService { 16 | 17 | /** 18 | * 房东的核心业务功能 19 | */ 20 | @Override 21 | public void service() { 22 | //输出仅仅代表业务处理 23 | System.out.println("签合同..."); 24 | System.out.println("收房租..."); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /ssm-spring-aop/src/main/java/com/uifuture/spring/aop/xml/service/UserService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.spring.aop.xml.service; 6 | 7 | /** 8 | * 用户服务 9 | * 使用jdk动态代理 10 | * 11 | * @author chenhx 12 | * @version UserService.java, v 0.1 2019-06-27 19:44 chenhx 13 | */ 14 | public interface UserService { 15 | 16 | /** 17 | * 业务接口 18 | * 19 | * @param name 20 | * @return 21 | */ 22 | String say(String name); 23 | } 24 | -------------------------------------------------------------------------------- /ssm-spring-aop/src/main/java/com/uifuture/spring/aop/xml/service/impl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.spring.aop.xml.service.impl; 6 | 7 | import com.uifuture.spring.aop.xml.service.UserService; 8 | 9 | /** 10 | * @author chenhx 11 | * @version UserServiceImpl.java, v 0.1 2019-06-27 19:45 chenhx 12 | */ 13 | public class UserServiceImpl implements UserService { 14 | @Override 15 | public String say(String name) { 16 | System.out.println("进入UserServiceImpl方法"); 17 | return "say" + name; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ssm-spring-aop/src/test/java/com/uifuture/spring/aop/xml/service/impl/UserServiceImplTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.spring.aop.xml.service.impl; 6 | 7 | import com.uifuture.spring.aop.xml.service.UserService; 8 | import org.junit.Test; 9 | import org.springframework.context.ApplicationContext; 10 | import org.springframework.context.support.ClassPathXmlApplicationContext; 11 | 12 | /** 13 | * @author chenhx 14 | * @version UserServiceImplTest.java, v 0.1 2019-06-27 20:03 chenhx 15 | */ 16 | public class UserServiceImplTest { 17 | @Test 18 | public void say() { 19 | ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring-content.xml"); 20 | UserService userService = applicationContext.getBean("userServiceImpl", UserService.class); 21 | userService.say("你好"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ssm-spring-core-bean/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | uifuture-ssm 7 | com.uifuture 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | ssm-spring-core-bean 13 | 1.0.0 14 | 15 | 16 | -------------------------------------------------------------------------------- /ssm-spring-core-bean/src/main/java/com/uifuture/spring/core/bean/createbean/Animal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.spring.core.bean.createbean; 6 | 7 | /** 8 | * 动物接口 9 | * 10 | * @author chenhx 11 | * @version Animal.java, v 0.1 2019-03-13 22:27 chenhx 12 | */ 13 | public interface Animal { 14 | void say(); 15 | } -------------------------------------------------------------------------------- /ssm-spring-core-bean/src/main/java/com/uifuture/spring/core/bean/createbean/AnimalBeanExampleFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.spring.core.bean.createbean; 6 | 7 | /** 8 | * 实例工厂类 9 | * 10 | * @author chenhx 11 | * @version AnimalBeanFactory.java, v 0.1 2019-03-13 22:24 chenhx 12 | */ 13 | public class AnimalBeanExampleFactory { 14 | /** 15 | * name参数决定哪个是Bean的实例 16 | * 17 | * @param name 18 | * @return 19 | */ 20 | public Animal getAnimal(String name) { 21 | if ("dog".equalsIgnoreCase(name)) { 22 | return new Dog(); 23 | } else if ("cat".equalsIgnoreCase(name)) { 24 | return new Cat(); 25 | } 26 | return null; 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /ssm-spring-core-bean/src/main/java/com/uifuture/spring/core/bean/createbean/AnimalBeanFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.spring.core.bean.createbean; 6 | 7 | /** 8 | * 动物 静态工厂类 9 | * 10 | * @author chenhx 11 | * @version AnimalBeanFactory.java, v 0.1 2019-03-13 22:24 chenhx 12 | */ 13 | public class AnimalBeanFactory { 14 | /** 15 | * name参数决定哪个是Bean的实例 16 | * 17 | * @param name 18 | * @return 19 | */ 20 | public static Animal getAnimal(String name) { 21 | if ("dog".equalsIgnoreCase(name)) { 22 | return new Dog(); 23 | } else if ("cat".equalsIgnoreCase(name)) { 24 | return new Cat(); 25 | } 26 | return null; 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /ssm-spring-core-bean/src/main/java/com/uifuture/spring/core/bean/createbean/Cat.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.spring.core.bean.createbean; 6 | 7 | /** 8 | * @author chenhx 9 | * @version Cat.java, v 0.1 2019-03-13 22:26 chenhx 10 | */ 11 | public class Cat implements Animal { 12 | private String age; 13 | 14 | @Override 15 | public void say() { 16 | System.out.println("i am cat.age=" + age); 17 | } 18 | 19 | public void setAge(String age) { 20 | this.age = age; 21 | } 22 | } -------------------------------------------------------------------------------- /ssm-spring-core-bean/src/main/java/com/uifuture/spring/core/bean/createbean/Dog.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.spring.core.bean.createbean; 6 | 7 | /** 8 | * @author chenhx 9 | * @version Dog.java, v 0.1 2019-03-13 22:26 chenhx 10 | */ 11 | public class Dog implements Animal { 12 | private String age; 13 | 14 | @Override 15 | public void say() { 16 | System.out.println("i am dog.age=" + age); 17 | } 18 | 19 | public void setAge(String age) { 20 | this.age = age; 21 | } 22 | } -------------------------------------------------------------------------------- /ssm-spring-core-bean/src/main/java/com/uifuture/spring/core/bean/dao/UserDao.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.spring.core.bean.dao; 6 | 7 | /** 8 | * @author chenhx 9 | * @version UserDao.java, v 0.1 2019-03-05 19:03 chenhx 10 | */ 11 | public class UserDao { 12 | } -------------------------------------------------------------------------------- /ssm-spring-core-bean/src/main/java/com/uifuture/spring/core/bean/entity/Chinese.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.spring.core.bean.entity; 6 | 7 | /** 8 | * @author chenhx 9 | * @version Chinese.java, v 0.1 2019-02-16 15:26 chenhx 10 | */ 11 | //@Configuration 12 | //@Scope(scopeName = "singleton") 13 | public class Chinese { 14 | private String message; 15 | 16 | public void setMessage(String message) { 17 | this.message = message; 18 | } 19 | 20 | public void getMessage() { 21 | System.out.println("Message : " + message); 22 | } 23 | } -------------------------------------------------------------------------------- /ssm-spring-core-bean/src/main/java/com/uifuture/spring/core/bean/event/RegisterListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.spring.core.bean.event; 6 | 7 | import org.springframework.context.ApplicationEvent; 8 | import org.springframework.context.ApplicationListener; 9 | 10 | /** 11 | * 注册监听器 12 | * 13 | * @author chenhx 14 | * @version RegisterListener.java, v 0.1 2019-04-19 21:39 chenhx 15 | */ 16 | public class RegisterListener implements ApplicationListener { 17 | @Override 18 | public void onApplicationEvent(ApplicationEvent event) { 19 | if (event instanceof RegisterEvent) { 20 | RegisterEvent registerEvent = (RegisterEvent) event; 21 | System.out.println(registerEvent.getUsername()); 22 | System.out.println(registerEvent.getEmail()); 23 | } else { 24 | System.out.println("其他事件,该事件不在监听范围:" + event); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /ssm-spring-core-bean/src/main/java/com/uifuture/spring/core/bean/life/LifeAnnotationService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.spring.core.bean.life; 6 | 7 | import javax.annotation.PostConstruct; 8 | import javax.annotation.PreDestroy; 9 | 10 | /** 11 | * 使用注解来指定初始化和销毁方法 12 | * 13 | * @author chenhx 14 | * @version LifeAnnotationService.java, v 0.1 2019-02-25 20:08 chenhx 15 | */ 16 | public class LifeAnnotationService { 17 | 18 | /** 19 | * 销毁方法 20 | * 21 | * @throws Exception 22 | */ 23 | @PreDestroy 24 | public void preDestroy() throws Exception { 25 | System.out.println("执行preDestroy注解标注的方法"); 26 | } 27 | 28 | /** 29 | * 初始化方法 30 | * 31 | * @throws Exception 32 | */ 33 | @PostConstruct 34 | public void initPostConstruct() throws Exception { 35 | System.out.println("执行PostConstruct注解标注的方法"); 36 | } 37 | } -------------------------------------------------------------------------------- /ssm-spring-core-bean/src/main/java/com/uifuture/spring/core/bean/life/LifeService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.spring.core.bean.life; 6 | 7 | import org.springframework.beans.factory.DisposableBean; 8 | import org.springframework.beans.factory.InitializingBean; 9 | 10 | /** 11 | * 实现InitializingBean接口与DisposableBean接口 12 | * 13 | * @author chenhx 14 | * @version LifeService.java, v 0.1 2019-02-25 19:07 chenhx 15 | */ 16 | public class LifeService implements InitializingBean, DisposableBean { 17 | @Override 18 | public void destroy() throws Exception { 19 | System.out.println("执行LifeService类、DisposableBean接口的destroy方法"); 20 | } 21 | 22 | @Override 23 | public void afterPropertiesSet() throws Exception { 24 | System.out.println("执行LifeService类、InitializingBean接口的afterPropertiesSet方法"); 25 | } 26 | } -------------------------------------------------------------------------------- /ssm-spring-core-bean/src/main/java/com/uifuture/spring/core/bean/life/LifeXmlService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.spring.core.bean.life; 6 | 7 | /** 8 | * XML配置Bean的初始化动作以及销毁动作 9 | * 10 | * @author chenhx 11 | * @version LifeXmlService.java, v 0.1 2019-02-25 19:19 chenhx 12 | */ 13 | public class LifeXmlService { 14 | 15 | /** 16 | * 通过的destroy-method属性指定的销毁方法 17 | * 18 | * @throws Exception 19 | */ 20 | public void destroyMethod() throws Exception { 21 | System.out.println("执行XML配置的destroy-method方法"); 22 | } 23 | 24 | /** 25 | * 通过的init-method属性指定的初始化方法 26 | * 27 | * @throws Exception 28 | */ 29 | public void initMethod() throws Exception { 30 | System.out.println("执行XML配置的init-method方法"); 31 | } 32 | } -------------------------------------------------------------------------------- /ssm-spring-core-bean/src/main/java/com/uifuture/spring/core/bean/service/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.spring.core.bean.service; 6 | 7 | import com.uifuture.spring.core.bean.dao.UserDao; 8 | import org.springframework.stereotype.Component; 9 | 10 | /** 11 | * 通过注解定义一个Bean 12 | * 13 | * @author chenhx 14 | * @version UserServiceImpl.java, v 0.1 2019-03-05 18:35 chenhx 15 | */ 16 | @Component("userService") 17 | public class UserServiceImpl { 18 | private UserDao userDao; 19 | 20 | public UserServiceImpl() { 21 | } 22 | 23 | public UserServiceImpl(UserDao userDao) { 24 | this.userDao = userDao; 25 | } 26 | 27 | /** 28 | * Setter method for property userDao. 29 | * 30 | * @param userDao value to be assigned to property userDao 31 | */ 32 | public void setUserDao(UserDao userDao) { 33 | this.userDao = userDao; 34 | } 35 | } -------------------------------------------------------------------------------- /ssm-spring-core-bean/src/main/java/com/uifuture/spring/core/bean/task/PrintTimeTask.java: -------------------------------------------------------------------------------- 1 | /* 2 | * copyfuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.spring.core.bean.task; 6 | 7 | import org.springframework.scheduling.annotation.Scheduled; 8 | import org.springframework.stereotype.Component; 9 | 10 | import java.text.SimpleDateFormat; 11 | import java.util.Date; 12 | 13 | /** 14 | * 定时任务类 15 | * 16 | * @author chenhx 17 | * @version PrintTimeTask.java, v 0.1 2019-04-29 19:56 chenhx 18 | */ 19 | @Component 20 | public class PrintTimeTask { 21 | @Scheduled(fixedDelay = 10000) 22 | public void printTime() { 23 | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 24 | Date date = new Date(); 25 | System.out.println(formatter.format(date)); 26 | } 27 | } -------------------------------------------------------------------------------- /ssm-spring-core-bean/src/main/resources/bean-spring-content.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /ssm-spring-core-bean/src/main/resources/event-spring-content.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /ssm-spring-core-bean/src/main/resources/schema-spring-content.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /ssm-spring-core-bean/src/main/resources/spring-content-create-bean-example.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ssm-spring-core-bean/src/main/resources/spring-content-create-bean.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /ssm-spring-core-bean/src/test/java/com/uifuture/spring/core/bean/entity/ConditionTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.spring.core.bean.entity; 6 | 7 | import com.uifuture.spring.core.bean.condition.config.UserConfig; 8 | import com.uifuture.spring.core.bean.condition.entity.User; 9 | import org.junit.Test; 10 | import org.springframework.context.annotation.AnnotationConfigApplicationContext; 11 | 12 | import java.util.Map; 13 | 14 | /** 15 | * 演示Condition接口的使用 16 | * 17 | * @author chenhx 18 | * @version ConditionTest.java, v 0.1 2019-03-21 20:46 chenhx 19 | */ 20 | public class ConditionTest { 21 | /** 22 | * 验证下这两个Bean是否已经都成功注入 23 | */ 24 | @Test 25 | public void loadUserBeanTest() { 26 | AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(UserConfig.class); 27 | Map map = applicationContext.getBeansOfType(User.class); 28 | System.out.println(map); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | uifuture-ssm 7 | com.uifuture 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | 13 | ssm-spring-ioc-demo 14 | 15 | 16 | -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/java/com/uifuture/ssm/spring/ioc/demo14_1/Person.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.spring.ioc.demo14_1; 6 | 7 | import com.uifuture.ssm.spring.ioc.entity.ObjectTarget; 8 | 9 | /** 10 | * 传统的new对象的方式 11 | * 12 | * @author chenhx 13 | * @version Person.java, v 0.1 2018-12-26 下午 8:08 chenhx 14 | */ 15 | public class Person { 16 | /** 17 | * 获取一个对象 18 | * 19 | * @return 20 | */ 21 | public ObjectTarget getObjectTarget() { 22 | ObjectTarget objectTarget = new ObjectTarget(); 23 | //... 24 | System.out.println("I find a objectTarget:" + objectTarget.toString()); 25 | return objectTarget; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/java/com/uifuture/ssm/spring/ioc/demo14_5/Say.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.spring.ioc.demo14_5; 2 | 3 | public interface Say { 4 | /** 5 | * @return 6 | */ 7 | String sayHello(); 8 | } 9 | -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/java/com/uifuture/ssm/spring/ioc/demo14_5/ioc/Person.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.spring.ioc.demo14_5.ioc; 2 | 3 | import com.uifuture.ssm.spring.ioc.demo14_5.Say; 4 | 5 | import java.util.Calendar; 6 | 7 | /** 8 | * IOC方式实现 9 | * chenhx 10 | */ 11 | public class Person implements Say { 12 | /** 13 | * 需要的引用 14 | */ 15 | private Calendar cal; 16 | 17 | public static void main(String args[]) { 18 | Person person = new Person(); 19 | person.setCal(Calendar.getInstance()); 20 | System.out.println(person.sayHello()); 21 | } 22 | 23 | /** 24 | * 依赖注入 25 | * 26 | * @param cal 27 | */ 28 | public void setCal(Calendar cal) { 29 | this.cal = cal; 30 | } 31 | 32 | @Override 33 | public String sayHello() { 34 | if (cal.get(Calendar.AM_PM) == Calendar.AM) { 35 | return "上午好"; 36 | } else { 37 | return "下午好"; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/java/com/uifuture/ssm/spring/ioc/demo14_5/oop/Person.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.spring.ioc.demo14_5.oop; 2 | 3 | import com.uifuture.ssm.spring.ioc.demo14_5.Say; 4 | 5 | import java.util.Calendar; 6 | 7 | /** 8 | * 传统实现(非IOC方式) 9 | * chenhx 10 | */ 11 | public class Person implements Say { 12 | /** 13 | * 需要的引用 14 | */ 15 | private Calendar cal; 16 | 17 | public Person() { 18 | // 主动获取 19 | cal = Calendar.getInstance(); 20 | } 21 | 22 | public static void main(String args[]) { 23 | Person person = new Person(); 24 | System.out.println(person.sayHello()); 25 | } 26 | 27 | @Override 28 | public String sayHello() { 29 | if (cal.get(Calendar.AM_PM) == Calendar.AM) { 30 | return "上午好"; 31 | } else { 32 | return "下午好"; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/java/com/uifuture/ssm/spring/ioc/demo14_6/ioc/Pay.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.spring.ioc.demo14_6.ioc; 2 | 3 | /** 4 | * 接口 5 | */ 6 | public interface Pay { 7 | void pay(); 8 | } 9 | -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/java/com/uifuture/ssm/spring/ioc/demo14_6/ioc/impl/AliPayImpl.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.spring.ioc.demo14_6.ioc.impl; 2 | 3 | import com.uifuture.ssm.spring.ioc.demo14_6.ioc.Pay; 4 | 5 | /** 6 | * 支付宝支付 7 | */ 8 | public class AliPayImpl implements Pay { 9 | @Override 10 | public void pay() { 11 | System.out.println("支付宝支付"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/java/com/uifuture/ssm/spring/ioc/demo14_6/ioc/impl/PayImpl.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.spring.ioc.demo14_6.ioc.impl; 2 | 3 | import com.uifuture.ssm.spring.ioc.demo14_6.ioc.Pay; 4 | 5 | /** 6 | * 支付基类 7 | */ 8 | public class PayImpl implements Pay { 9 | private Pay pay; 10 | 11 | public static void main(String[] args) { 12 | PayImpl pay = new PayImpl(); 13 | pay.setPay(new AliPayImpl()); 14 | pay.pay(); 15 | } 16 | 17 | public void setPay(Pay pay) { 18 | this.pay = pay; 19 | } 20 | 21 | @Override 22 | public void pay() { 23 | pay.pay(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/java/com/uifuture/ssm/spring/ioc/demo14_6/ioc/impl/WxPayImpl.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.spring.ioc.demo14_6.ioc.impl; 2 | 3 | import com.uifuture.ssm.spring.ioc.demo14_6.ioc.Pay; 4 | 5 | /** 6 | * 微信支付 7 | */ 8 | public class WxPayImpl implements Pay { 9 | @Override 10 | public void pay() { 11 | System.out.println("微信支付"); 12 | } 13 | } -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/java/com/uifuture/ssm/spring/ioc/demo14_6/terrible/PayImpl.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.spring.ioc.demo14_6.terrible; 2 | 3 | /** 4 | * 最糟糕的写法 5 | */ 6 | public class PayImpl { 7 | public void pay(Integer type) { 8 | if (type.equals(1)) { 9 | new WxPay().pay(); 10 | } else if (type.equals(2)) { 11 | new AliPay().pay(); 12 | } else { 13 | System.out.println("非常抱歉,暂不支持该种支付方式,请使用微信或者支付宝进行支付。"); 14 | } 15 | } 16 | 17 | class WxPay { 18 | public void pay() { 19 | System.out.println("微信支付"); 20 | } 21 | } 22 | 23 | class AliPay { 24 | public void pay() { 25 | System.out.println("支付宝支付"); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/java/com/uifuture/ssm/spring/ioc/demo14_7/config/BeanConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.spring.ioc.demo14_7.config; 2 | 3 | import com.uifuture.ssm.spring.ioc.demo14_7.dao.SpringIoCDao; 4 | import com.uifuture.ssm.spring.ioc.demo14_7.dao.impl.SpringIoCDaoImpl; 5 | import com.uifuture.ssm.spring.ioc.demo14_7.service.SpringIoCService; 6 | import com.uifuture.ssm.spring.ioc.demo14_7.service.impl.SpringIoCServiceImpl; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.context.annotation.Configuration; 9 | 10 | /** 11 | * 使用注解注入Bean 12 | */ 13 | @Configuration 14 | public class BeanConfiguration { 15 | @Bean 16 | public SpringIoCDao springIoCDao() { 17 | return new SpringIoCDaoImpl(); 18 | } 19 | 20 | @Bean 21 | public SpringIoCService springIoCService() { 22 | SpringIoCServiceImpl bean = new SpringIoCServiceImpl(); 23 | //注入dao 24 | bean.setSpringIoCDao(springIoCDao()); 25 | return bean; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/java/com/uifuture/ssm/spring/ioc/demo14_7/constructor/entity/Person.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.spring.ioc.demo14_7.constructor.entity; 2 | 3 | /** 4 | * 演示构造函数注入 5 | */ 6 | public class Person { 7 | private String address; 8 | private String name; 9 | 10 | /** 11 | * 构造函数 12 | */ 13 | public Person(String name, String address) { 14 | this.address = address; 15 | this.name = name; 16 | } 17 | 18 | @Override 19 | public String toString() { 20 | return "Person{" + 21 | "address='" + address + '\'' + 22 | ", name='" + name + '\'' + 23 | '}'; 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/java/com/uifuture/ssm/spring/ioc/demo14_7/constructor/pojo/A.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.spring.ioc.demo14_7.constructor.pojo; 2 | 3 | /** 4 | * 循环依赖 5 | */ 6 | public class A { 7 | private B b; 8 | 9 | public A(B b) { 10 | this.b = b; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/java/com/uifuture/ssm/spring/ioc/demo14_7/constructor/pojo/B.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.spring.ioc.demo14_7.constructor.pojo; 2 | 3 | /** 4 | * 循环依赖 5 | */ 6 | public class B { 7 | private A a; 8 | 9 | public B(A a) { 10 | this.a = a; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/java/com/uifuture/ssm/spring/ioc/demo14_7/constructor/service/impl/SpringIoCServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.spring.ioc.demo14_7.constructor.service.impl; 2 | 3 | 4 | import com.uifuture.ssm.spring.ioc.demo14_7.dao.SpringIoCDao; 5 | import com.uifuture.ssm.spring.ioc.demo14_7.service.SpringIoCService; 6 | 7 | public class SpringIoCServiceImpl implements SpringIoCService { 8 | /** 9 | * 待注入对象 10 | */ 11 | private SpringIoCDao springIoCDao; 12 | 13 | /** 14 | * 构造函数注入对象 15 | * 16 | * @param springIoCDao 17 | */ 18 | public SpringIoCServiceImpl(SpringIoCDao springIoCDao) { 19 | this.springIoCDao = springIoCDao; 20 | } 21 | 22 | @Override 23 | public void saySpringIoC() { 24 | System.out.println("constructor->SpringIoCServiceImpl->saySpringIoC()"); 25 | springIoCDao.saySpringIoC(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/java/com/uifuture/ssm/spring/ioc/demo14_7/dao/SpringIoCDao.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.spring.ioc.demo14_7.dao; 2 | 3 | /** 4 | * 演示SpringIoC 5 | */ 6 | public interface SpringIoCDao { 7 | void saySpringIoC(); 8 | } 9 | -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/java/com/uifuture/ssm/spring/ioc/demo14_7/dao/impl/SpringIoCDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.spring.ioc.demo14_7.dao.impl; 2 | 3 | import com.uifuture.ssm.spring.ioc.demo14_7.dao.SpringIoCDao; 4 | 5 | /** 6 | * 实现类 7 | */ 8 | public class SpringIoCDaoImpl implements SpringIoCDao { 9 | @Override 10 | public void saySpringIoC() { 11 | System.out.println("SpringIoCDaoImpl->saySpringIoC()"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/java/com/uifuture/ssm/spring/ioc/demo14_7/interface_injection/code_14_35/ClassA.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.spring.ioc.demo14_7.interface_injection.code_14_35; 6 | 7 | interface InterfaceB { 8 | void doSomething(); 9 | } 10 | 11 | /** 12 | * 接口注入的原始雏形 13 | * 14 | * @author chenhx 15 | * @version ClassA.java, v 0.1 2019-02-13 23:41 chenhx 16 | */ 17 | public class ClassA { 18 | private InterfaceB clzB; 19 | 20 | public void doSomething() throws ClassNotFoundException, IllegalAccessException, InstantiationException { 21 | Object obj = Class.forName("从配置文件中获取类名").newInstance(); 22 | clzB = (InterfaceB) obj; 23 | clzB.doSomething(); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/java/com/uifuture/ssm/spring/ioc/demo14_7/interface_injection/code_14_36/ClassA.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.spring.ioc.demo14_7.interface_injection.code_14_36; 6 | 7 | interface InterfaceB { 8 | void doSomething(); 9 | } 10 | 11 | /** 12 | * 容器型实现接口注入 13 | * 14 | * @author chenhx 15 | * @version ClassA.java, v 0.1 2019-02-13 23:54 chenhx 16 | */ 17 | public class ClassA { 18 | private InterfaceB clzB; 19 | 20 | public void doSomething(InterfaceB b) { 21 | clzB = b; 22 | clzB.doSomething(); 23 | } 24 | } -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/java/com/uifuture/ssm/spring/ioc/demo14_7/interface_injection/code_14_37/MyServlet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.spring.ioc.demo14_7.interface_injection.code_14_37; 6 | 7 | import javax.servlet.ServletException; 8 | import javax.servlet.http.HttpServlet; 9 | import javax.servlet.http.HttpServletRequest; 10 | import javax.servlet.http.HttpServletResponse; 11 | import java.io.IOException; 12 | 13 | /** 14 | * HttpServletRequest,HttpServletResponse是应用比较早期和广泛的接口型注入 15 | * 16 | * @author chenhx 17 | * @version MyServlet.java, v 0.1 2019-02-13 23:59 chenhx 18 | */ 19 | public class MyServlet extends HttpServlet { 20 | @Override 21 | protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 22 | //做一些事情 23 | } 24 | 25 | @Override 26 | protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 27 | //做一些事情 28 | } 29 | } -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/java/com/uifuture/ssm/spring/ioc/demo14_7/service/SpringIoCService.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.spring.ioc.demo14_7.service; 2 | 3 | /** 4 | * service接口 5 | */ 6 | public interface SpringIoCService { 7 | void saySpringIoC(); 8 | } 9 | -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/java/com/uifuture/ssm/spring/ioc/demo14_7/service/impl/SpringIoCServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.spring.ioc.demo14_7.service.impl; 2 | 3 | import com.uifuture.ssm.spring.ioc.demo14_7.dao.SpringIoCDao; 4 | import com.uifuture.ssm.spring.ioc.demo14_7.service.SpringIoCService; 5 | 6 | public class SpringIoCServiceImpl implements SpringIoCService { 7 | /** 8 | * 待注入对象 9 | */ 10 | private SpringIoCDao springIoCDao; 11 | 12 | public void setSpringIoCDao(SpringIoCDao springIoCDao) { 13 | this.springIoCDao = springIoCDao; 14 | } 15 | 16 | @Override 17 | public void saySpringIoC() { 18 | System.out.println("SpringIoCServiceImpl->saySpringIoC()"); 19 | springIoCDao.saySpringIoC(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/resources/spring-ioc-constructor-ab.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /ssm-spring-ioc-demo/src/main/resources/spring-ioc.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/java/com/uifuture/basics/commons/ResultCodeEnum.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.basics.commons; 6 | 7 | /** 8 | * 返回状态码枚举 9 | * 10 | * @author chenhx 11 | * @version ResultCodeEnum.java, v 0.1 2018-08-22 下午 9:23 12 | */ 13 | public enum ResultCodeEnum { 14 | /** 15 | * 返回成功状态码 16 | */ 17 | SUCCESS(200), 18 | /** 19 | * 失败状态码 20 | */ 21 | ERROR(-1); 22 | /** 23 | * 状态码 24 | */ 25 | private Integer code; 26 | 27 | ResultCodeEnum(Integer code) { 28 | this.code = code; 29 | } 30 | 31 | /** 32 | * Getter method for property code. 33 | * 34 | * @return property value of code 35 | */ 36 | public Integer getCode() { 37 | return code; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/java/com/uifuture/basics/controller/cache/StaticCacheController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.basics.controller.cache; 6 | 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.servlet.ModelAndView; 10 | 11 | /** 12 | * 静态资源的缓存演示 13 | * 章节:7.2.2 14 | * 15 | * @author chenhx 16 | * @version StaticCacheController.java, v 0.1 2018-08-18 下午 5:01 17 | */ 18 | @Controller 19 | @RequestMapping("cache") 20 | public class StaticCacheController { 21 | /** 22 | * 进行跳转到jsp页面,里面进行加载了静态资源 23 | * 24 | * @return 25 | */ 26 | @RequestMapping("index") 27 | public ModelAndView cache() { 28 | return new ModelAndView("/cache/index"); 29 | } 30 | } -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/java/com/uifuture/basics/service/SensitiveWordService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.basics.service; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * 获取敏感词列表 11 | * 12 | * @author chenhx 13 | * @version SensitiveWord.java, v 0.1 2018-08-30 下午 8:20 14 | */ 15 | public interface SensitiveWordService { 16 | /** 17 | * 获取所有的敏感词 18 | * 19 | * @return 20 | */ 21 | List selectAllSensitiveWord(); 22 | } 23 | -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/java/com/uifuture/basics/service/impl/SensitiveWordServiceImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * uifuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.basics.service.impl; 6 | 7 | import com.uifuture.basics.service.SensitiveWordService; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.util.Arrays; 11 | import java.util.List; 12 | 13 | /** 14 | * 获取敏感词 15 | * 16 | * @author chenhx 17 | * @version SensitiveWordServiceImpl.java, v 0.1 2018-08-30 下午 8:21 18 | */ 19 | @Service 20 | public class SensitiveWordServiceImpl implements SensitiveWordService { 21 | @Override 22 | public List selectAllSensitiveWord() { 23 | //模拟从数据库中获取敏感词 24 | return Arrays.asList("骂人", "敏感词"); 25 | } 26 | } -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/globalization/i18n.properties: -------------------------------------------------------------------------------- 1 | title=\u9ED8\u8BA4\u7684\u56FD\u9645\u5316\u914D\u7F6E 2 | welcome=\u4F60\u597D\uFF0C\u6B22\u8FCE\u8BBF\u95EE\u3002 3 | name=Spring MVC\u5B66\u4E60 -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/globalization/i18n_en_US.properties: -------------------------------------------------------------------------------- 1 | title=Default international configuration 2 | welcome=Hello,Welcome to visit 3 | name=Spring MVC learning -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/globalization/i18n_zh_CN.properties: -------------------------------------------------------------------------------- 1 | title=\u4E2D\u6587\u7684\u56FD\u9645\u5316\u914D\u7F6E 2 | welcome=\u4F60\u597D\uFF0C\u6B22\u8FCE\u8BBF\u95EE 3 | name=Spring MVC\u5B66\u4E60 -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | 6 | 7 | 8 | 9 | 10 | 11 | %d{yyyy-MM-dd HH:mm:ss,SSS} [%thread]%-5level %logger{100} - %msg%n 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/static/css/blue.css: -------------------------------------------------------------------------------- 1 | .font-color { 2 | color: blue; 3 | } -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/static/css/red.css: -------------------------------------------------------------------------------- 1 | .font-color { 2 | color: red; 3 | } -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/static/css/test.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenhaoxiang/uifuture-ssm/95db5ca3ab1d8da396b35a5f99aa798699c98c1d/ssm-spring-mvc/src/main/resources/static/css/test.css.gz -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/static/images/img1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenhaoxiang/uifuture-ssm/95db5ca3ab1d8da396b35a5f99aa798699c98c1d/ssm-spring-mvc/src/main/resources/static/images/img1.jpg -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/static/images/img1.jpg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenhaoxiang/uifuture-ssm/95db5ca3ab1d8da396b35a5f99aa798699c98c1d/ssm-spring-mvc/src/main/resources/static/images/img1.jpg.gz -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/static/js/test.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenhaoxiang/uifuture-ssm/95db5ca3ab1d8da396b35a5f99aa798699c98c1d/ssm-spring-mvc/src/main/resources/static/js/test.js.gz -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/static/testStatic.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SpringMVC 6 | 7 | 8 | 静态资源访问测试 9 | 10 | -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/static/testStatic.html.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenhaoxiang/uifuture-ssm/95db5ca3ab1d8da396b35a5f99aa798699c98c1d/ssm-spring-mvc/src/main/resources/static/testStatic.html.gz -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/theme/default.properties: -------------------------------------------------------------------------------- 1 | font.color=/static/css/blue.css -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/theme/red.properties: -------------------------------------------------------------------------------- 1 | font.color=/static/css/red.css -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/views/cache/index.jsp: -------------------------------------------------------------------------------- 1 | 6 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 7 | <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 8 | utils 9 | 10 | Title 11 | 13 | 14 | 15 |

演示静态资源的缓存

16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/views/download.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: 陈浩翔 4 | Date: 2018/08/04 5 | Time: 下午 07:00 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 9 | <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 10 | 11 | 12 | MVC Title 13 | 14 | 15 |
文件下载演示
16 |
17 |

下载小文件

18 |
19 | 20 | 21 |
22 |

下载大文件

23 |
24 | 25 | 26 |
27 | 28 | -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/views/error/error.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: 陈浩翔 4 | Date: 2018/08/07 5 | Time: 下午 10:51 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 9 | 10 | 11 | 错误页面 12 | 13 | 14 |
定制的错误页面
15 |
16 | ${code},${message} 17 | 18 | -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/views/error/httpMessageNotReadableException.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: 陈浩翔 4 | Date: 2018/08/07 5 | Time: 下午 10:51 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 9 | 10 | 11 | 错误页面 12 | 13 | 14 |
定制的HttpMessageNotReadableException异常页面
15 |
16 | ${data.code},${data.message} 17 | ${exception} 18 | 19 | -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/views/error/httpMessageNotWritableException.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: 陈浩翔 4 | Date: 2018/08/07 5 | Time: 下午 10:51 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 9 | 10 | 11 | 错误页面 12 | 13 | 14 |
定制的HttpMessageNotWritableException异常页面
15 |
16 | ${data.code},${data.message} 17 | ${exception} 18 | 19 | -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/views/error/otherError.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: 陈浩翔 4 | Date: 2018/08/07 5 | Time: 下午 10:51 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 9 | 10 | 11 | 错误页面 12 | 13 | 14 |
定制的other异常页面
15 |
16 | ${data.code},${data.message} 17 | ${exception} 18 | 19 | -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/views/forward/login.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: 陈浩翔 4 | Date: 2018/08/04 5 | Time: 下午 07:00 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 9 | 10 | 11 | MVC Title 12 | 13 | 14 |
演示转发
15 |
16 | 演示转发,username=${username} 17 | 18 | -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/views/i18n/index.jsp: -------------------------------------------------------------------------------- 1 | 6 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 7 | <%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %> 8 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 9 | 10 | 11 | <spring:message code="title" scope="session"></spring:message> 12 | 13 | 14 |

15 |
16 | 中文 17 | English 18 | 19 | -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/views/index.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: 陈浩翔 4 | Date: 2018/08/04 5 | Time: 下午 07:00 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 9 | 10 | 11 | MVC Title 12 | 13 | 14 |
Welcome to Spring MVC
15 |
16 | 欢迎! 17 | 18 | -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/views/redirect/login.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: 陈浩翔 4 | Date: 2018/08/04 5 | Time: 下午 07:00 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 9 | 10 | 11 | MVC Title 12 | 13 | 14 |
演示重定向
15 |
16 | 演示重定向,username=${username},password=${password} 17 | 18 | -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/views/theme.jsp: -------------------------------------------------------------------------------- 1 | 5 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 6 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 7 | <%--引入Sprign的taglib--%> 8 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 9 | 10 | 11 | 主题演示页面 12 | 13 | 14 | 15 |

主题演示页面

16 |

字体颜色的变化演示

17 | 使用session进行设置主题:
18 | 21 | 24 | 下面使用Spring MVC中内置的拦截器进行切换主题:
25 | 28 | 31 | 32 | -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/views/upload/index.jsp: -------------------------------------------------------------------------------- 1 | 5 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 6 | <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 7 | 8 | 9 | 文件上传 10 | 11 | 12 |

文件上传演示

13 | <%--表单的 method 必须为 post,enctype 为 multipart/form-data--%> 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
请上传头像:
30 |
31 | 32 | -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/views/upload/message.jsp: -------------------------------------------------------------------------------- 1 | 5 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 6 | 7 | 8 | 文件上传提示 9 | 10 | 11 |

文件上传提示

12 | ${message} 13 | 14 | -------------------------------------------------------------------------------- /ssm-spring-mvc/src/main/resources/views/userInfo.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | 3 | 4 | 5 | 演示BeanNameUrlHandlerMapping 6 | 7 | 8 | 用户信息:${user} 9 | 10 | -------------------------------------------------------------------------------- /ssm-uifuture/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | **/log4j.properties.back 14 | **/email.properties.back 15 | **/common.properties.back 16 | **/mq.properties.back 17 | 18 | ### IntelliJ IDEA ### 19 | .idea 20 | *.iws 21 | *.iml 22 | *.ipr 23 | *.class 24 | *.log 25 | */classes/artifacts/ 26 | 27 | ### maven ### 28 | .mvn 29 | 30 | ### log ### 31 | log.path_IS_UNDEFINED 32 | 33 | ### NetBeans ### 34 | /nbproject/private/ 35 | /build/ 36 | /nbbuild/ 37 | /dist/ 38 | /nbdist/ 39 | /.nb-gradle/ 40 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/aliyun/model/UbBodyModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.aliyun.model; 6 | 7 | import com.uifuture.ssm.enums.MqTypeEnum; 8 | import lombok.Data; 9 | 10 | import java.io.Serializable; 11 | 12 | /** 13 | * @author chenhx 14 | * @version UbBodyModel.java, v 0.1 2019-11-14 17:46 chenhx 15 | */ 16 | @Data 17 | public class UbBodyModel implements Serializable { 18 | private static final long serialVersionUID = 7643613014199376375L; 19 | 20 | /** 21 | * 类型 22 | */ 23 | private MqTypeEnum mqTypeEnum; 24 | 25 | private T data; 26 | } 27 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/base/BaseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.base; 6 | 7 | import com.uifuture.ssm.enums.ResultCodeEnum; 8 | import lombok.Data; 9 | 10 | /** 11 | * @author chenhx 12 | * @version BaseException.java, v 0.1 2019-09-14 11:44 chenhx 13 | */ 14 | @Data 15 | public class BaseException extends RuntimeException { 16 | protected Integer code; 17 | 18 | protected String message; 19 | 20 | 21 | public BaseException(Integer code, String message) { 22 | super("code:" + code + ",message:" + message); 23 | this.code = code; 24 | this.message = message; 25 | } 26 | 27 | 28 | public BaseException(ResultCodeEnum resultCodeEnum) { 29 | super("code:" + resultCodeEnum.getValue() + ",message:" + resultCodeEnum.getName()); 30 | this.code = resultCodeEnum.getValue(); 31 | this.message = resultCodeEnum.getName(); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/common/UsersConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.common; 6 | 7 | /** 8 | * 用户常量 9 | * 10 | * @author chenhx 11 | * @version UsersConstants.java, v 0.1 2019-09-16 15:54 chenhx 12 | */ 13 | public class UsersConstants { 14 | 15 | /** 16 | * 用户登录后,存储在session中的用户信息key 17 | */ 18 | public static final String SESSION_USERS_LOGIN_INFO = "SESSION_USERS_LOGIN_INFO"; 19 | 20 | /** 21 | * 用户登录后,存储在Cookie中的用户信息key 22 | */ 23 | public static final String COOKIE_USERS_LOGIN_INFO = "COOKIE_USERS_LOGIN_INFO"; 24 | 25 | /** 26 | * 30天,单位秒 27 | */ 28 | public static final Integer EXPIRATION_DATE_30 = 30 * 24 * 60 * 60; 29 | /** 30 | * 用户上传资源次数 31 | */ 32 | public static final Integer UPLOAD_TIMES = 100; 33 | /** 34 | * 限制资源文件只能是ZIP压缩文件 35 | */ 36 | public static final String UPLOAD_SUFFIX = ".zip"; 37 | } 38 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/config/SysConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * copyfuture.com 3 | * Copyright (C) 2013-2018 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.config; 6 | 7 | import lombok.Data; 8 | import org.springframework.beans.factory.annotation.Value; 9 | import org.springframework.context.annotation.Configuration; 10 | 11 | /** 12 | * 系统配置类 13 | * @author chenhx 14 | * @version SysConfig.java, v 0.1 2018-07-20 16:27 15 | */ 16 | @Configuration 17 | @Data 18 | public class SysConfig { 19 | /*********************系统当前运行环境********************/ 20 | @Value("${application.env}") 21 | private String applicationEnv; 22 | 23 | /** 24 | * 图片cdn 25 | */ 26 | @Value("${cdn.images.href}") 27 | private String cdnImagesHref; 28 | /** 29 | * 支付宝支付私钥 30 | */ 31 | @Value("${alipay.private.key}") 32 | private String aliPayPrivateKey; 33 | /** 34 | * 支付宝支付公钥 35 | */ 36 | @Value("${alipay.public.key}") 37 | private String aliPayPublicKey; 38 | } 39 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/controller/IpController.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.controller; 2 | 3 | 4 | import com.uifuture.ssm.base.BaseController; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | *

10 | * 用户ip表 前端控制器 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-19 15 | */ 16 | @RestController 17 | @RequestMapping("/ip-entity") 18 | public class IpController extends BaseController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/controller/IpDetailsController.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.controller; 2 | 3 | 4 | import com.uifuture.ssm.base.BaseController; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | *

10 | * ip详情表-通过数据中心查找ip查找出来的 前端控制器 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-19 15 | */ 16 | @RestController 17 | @RequestMapping("/ip-details-entity") 18 | public class IpDetailsController extends BaseController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/controller/PayTypeController.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.controller; 2 | 3 | 4 | import com.uifuture.ssm.base.BaseController; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | *

10 | * 支付类型表。 前端控制器 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-11-06 15 | */ 16 | @RestController 17 | @RequestMapping("/pay-type-entity") 18 | public class PayTypeController extends BaseController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/controller/RResourceSubjectController.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.controller; 2 | 3 | 4 | import com.uifuture.ssm.base.BaseController; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | *

10 | * 资源与专题关系表。 前端控制器 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-18 15 | */ 16 | @RestController 17 | @RequestMapping("/r-resource-subject-entity") 18 | public class RResourceSubjectController extends BaseController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/controller/RResourceTagsController.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.controller; 2 | 3 | 4 | import com.uifuture.ssm.base.BaseController; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | *

10 | * 资源标签关系表。 前端控制器 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-24 15 | */ 16 | @RestController 17 | @RequestMapping("/r-resource-tags-entity") 18 | public class RResourceTagsController extends BaseController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/controller/RResourceTypeController.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.controller; 2 | 3 | 4 | import com.uifuture.ssm.base.BaseController; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | *

10 | * 资源与资源分类关系表 前端控制器 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-18 15 | */ 16 | @RestController 17 | @RequestMapping("/r-resource-type-entity") 18 | public class RResourceTypeController extends BaseController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/controller/RUsersCollectionsController.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.controller; 2 | 3 | 4 | import com.uifuture.ssm.base.BaseController; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | *

10 | * 用户收藏资源相关表。 前端控制器 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-21 15 | */ 16 | @RestController 17 | @RequestMapping("/r-users-collections-entity") 18 | public class RUsersCollectionsController extends BaseController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/controller/ResourceContentController.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.controller; 2 | 3 | 4 | import com.uifuture.ssm.base.BaseController; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | *

10 | * 前端控制器 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-18 15 | */ 16 | @RestController 17 | @RequestMapping("/resource-content-entity") 18 | public class ResourceContentController extends BaseController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/controller/ResourceController.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.controller; 2 | 3 | 4 | import com.uifuture.ssm.base.BaseController; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | *

10 | * 资源表。 前端控制器 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-18 15 | */ 16 | @RestController 17 | @RequestMapping("/resource-entity") 18 | public class ResourceController extends BaseController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/controller/ResourceSubjectController.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.controller; 2 | 3 | 4 | import com.uifuture.ssm.base.BaseController; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | *

10 | * 资源专题表 前端控制器 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-18 15 | */ 16 | @RestController 17 | @RequestMapping("/resource-subject-entity") 18 | public class ResourceSubjectController extends BaseController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/controller/ResourceTypeController.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.controller; 2 | 3 | 4 | import com.uifuture.ssm.base.BaseController; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | *

10 | * 资源分类表。 前端控制器 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-18 15 | */ 16 | @RestController 17 | @RequestMapping("/resource-type") 18 | public class ResourceTypeController extends BaseController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/controller/SensitiveWordController.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.controller; 2 | 3 | 4 | import com.uifuture.ssm.base.BaseController; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | *

10 | * 敏感词 前端控制器 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-23 15 | */ 16 | @RestController 17 | @RequestMapping("/sensitive-word-entity") 18 | public class SensitiveWordController extends BaseController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/controller/StopWordController.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.controller; 2 | 3 | 4 | import com.uifuture.ssm.base.BaseController; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | *

10 | * 敏感词过滤之-停顿词 前端控制器 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-23 15 | */ 16 | @RestController 17 | @RequestMapping("/stop-word-entity") 18 | public class StopWordController extends BaseController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/controller/TagsController.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.controller; 2 | 3 | 4 | import com.uifuture.ssm.base.BaseController; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | *

10 | * 标签表。 前端控制器 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-18 15 | */ 16 | @RestController 17 | @RequestMapping("/tags-entity") 18 | public class TagsController extends BaseController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/controller/TestController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.controller; 6 | 7 | import com.uifuture.ssm.base.BaseController; 8 | import lombok.extern.slf4j.Slf4j; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.servlet.ModelAndView; 12 | 13 | /** 14 | * 测试 15 | * 16 | * @author chenhx 17 | * @version TestController.java, v 0.1 2019-09-14 00:25 chenhx 18 | */ 19 | @RequestMapping("/testController") 20 | @Slf4j 21 | @Controller 22 | public class TestController extends BaseController { 23 | 24 | @RequestMapping("index") 25 | public ModelAndView index() { 26 | log.info("访问testController/index"); 27 | return new ModelAndView("index"); 28 | } 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/controller/UsersCommentController.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.controller; 2 | 3 | 4 | import com.uifuture.ssm.base.BaseController; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | *

10 | * 用户评论表 前端控制器 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-21 15 | */ 16 | @RestController 17 | @RequestMapping("/users-comment-entity") 18 | public class UsersCommentController extends BaseController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/controller/UsersController.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.controller; 2 | 3 | import com.uifuture.ssm.base.BaseController; 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | /** 9 | *

10 | * 用户表 前端控制器 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-12 15 | */ 16 | @RequestMapping("/users") 17 | @Slf4j 18 | @Controller 19 | public class UsersController extends BaseController { 20 | 21 | } 22 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/controller/UsersFocusController.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.controller; 2 | 3 | 4 | import com.uifuture.ssm.base.BaseController; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | *

10 | * 用户关注表 前端控制器 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-19 15 | */ 16 | @RestController 17 | @RequestMapping("/users-focus-entity") 18 | public class UsersFocusController extends BaseController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/controller/UsersRechargeUbController.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.controller; 2 | 3 | 4 | import com.uifuture.ssm.base.BaseController; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | *

10 | * 用户充值U币表,存放用户充值U币信息。 前端控制器 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-11-06 15 | */ 16 | @RestController 17 | @RequestMapping("/users-recharge-ub-entity") 18 | public class UsersRechargeUbController extends BaseController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/convert/ResourceContentConvert.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.convert; 6 | 7 | import com.uifuture.ssm.dto.ResourceContentDTO; 8 | import com.uifuture.ssm.entity.ResourceContentEntity; 9 | import org.mapstruct.Mapper; 10 | import org.mapstruct.factory.Mappers; 11 | 12 | /** 13 | * @author chenhx 14 | * @version ResourceContentConvert.java, v 0.1 2019-09-18 18:07 chenhx 15 | */ 16 | @Mapper 17 | public interface ResourceContentConvert { 18 | 19 | 20 | ResourceContentConvert INSTANCE = Mappers.getMapper(ResourceContentConvert.class); 21 | 22 | /** 23 | * Entity -> DTO 24 | * 25 | * @param entity 26 | * @return 27 | */ 28 | ResourceContentDTO entityToDto(ResourceContentEntity entity); 29 | 30 | /** 31 | * DTO -> Entity 32 | * 33 | * @param entity 34 | * @return 35 | */ 36 | ResourceContentEntity dtoToEntity(ResourceContentDTO entity); 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/convert/ResourceTypeConvert.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.convert; 6 | 7 | import com.uifuture.ssm.dto.ResourceTypeDTO; 8 | import com.uifuture.ssm.entity.ResourceTypeEntity; 9 | import org.mapstruct.Mapper; 10 | import org.mapstruct.factory.Mappers; 11 | 12 | /** 13 | * @author chenhx 14 | * @version ResourceTypeConvert.java, v 0.1 2019-09-25 00:49 chenhx 15 | */ 16 | @Mapper 17 | public interface ResourceTypeConvert { 18 | 19 | ResourceTypeConvert INSTANCE = Mappers.getMapper(ResourceTypeConvert.class); 20 | 21 | /** 22 | * Entity -> DTO 23 | * 24 | * @param entity 25 | * @return 26 | */ 27 | ResourceTypeDTO entityTo(ResourceTypeEntity entity); 28 | 29 | /** 30 | * DTO -> Entity 31 | * 32 | * @param entity 33 | * @return 34 | */ 35 | ResourceTypeEntity toEntity(ResourceTypeDTO entity); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/convert/UsersPayConvert.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.convert; 6 | 7 | import com.uifuture.ssm.dto.UsersPayDTO; 8 | import com.uifuture.ssm.entity.UsersPayEntity; 9 | import com.uifuture.ssm.req.UsersPayReq; 10 | import org.mapstruct.Mapper; 11 | import org.mapstruct.factory.Mappers; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | * @author chenhx 17 | * @version UsersPayConvert.java, v 0.1 2019-11-06 20:54 chenhx 18 | */ 19 | @Mapper 20 | public interface UsersPayConvert { 21 | 22 | UsersPayConvert INSTANCE = Mappers.getMapper(UsersPayConvert.class); 23 | 24 | UsersPayEntity usersPayReqToUsersPayEntity(UsersPayReq usersPayReq); 25 | 26 | UsersPayDTO usersPayEntityToUsersPayDTO(UsersPayEntity usersPayEntity); 27 | 28 | List usersPayEntityToUsersPayDTOList(List usersPayEntityS); 29 | } 30 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/dto/FileInfoDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.dto; 6 | 7 | import lombok.Data; 8 | 9 | import java.io.Serializable; 10 | 11 | /** 12 | * 资源文件上传后返回信息 13 | * @author chenhx 14 | * @version FileInfoDTO.java, v 0.1 2019-09-18 16:42 chenhx 15 | */ 16 | @Data 17 | public class FileInfoDTO implements Serializable { 18 | 19 | private static final long serialVersionUID = -3706119957109881115L; 20 | 21 | /** 22 | * 新的文件名称 23 | */ 24 | private String newFileName; 25 | /** 26 | * 原来的文件名称 27 | */ 28 | private String oldFileName; 29 | /** 30 | * 文件存储路径 31 | */ 32 | private String path; 33 | } 34 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/dto/FileOssUrlDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.dto; 6 | 7 | import lombok.Data; 8 | 9 | import java.io.Serializable; 10 | 11 | /** 12 | * 图片上传到OSS返回信息 13 | * 14 | * @author chenhx 15 | * @version FileOssUrlDTO.java, v 0.1 2019-09-19 00:37 chenhx 16 | */ 17 | @Data 18 | public class FileOssUrlDTO implements Serializable { 19 | 20 | private static final long serialVersionUID = 4891476444313164521L; 21 | /** 22 | * 文件名 23 | */ 24 | private String fileName; 25 | 26 | /** 27 | * oss URL 28 | */ 29 | private String ossUrl; 30 | } 31 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/dto/PageDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.dto; 6 | 7 | import lombok.Data; 8 | 9 | import java.io.Serializable; 10 | 11 | /** 12 | * @author chenhx 13 | * @version PageDTO.java, v 0.1 2019-11-07 16:56 chenhx 14 | */ 15 | @Data 16 | public class PageDTO implements Serializable { 17 | private static final long serialVersionUID = -8375628539328092637L; 18 | /** 19 | * 当前页 20 | */ 21 | private Integer currentIndex = 1; 22 | 23 | /** 24 | * 每页记录数 25 | */ 26 | private Integer pageSize = 20; 27 | 28 | /** 29 | * 用户id 30 | */ 31 | private Integer usersId; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/dto/ResourceContentDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.dto; 6 | 7 | import lombok.Data; 8 | 9 | import java.io.Serializable; 10 | 11 | /** 12 | * @author chenhx 13 | * @version ResourceContentDTO.java, v 0.1 2019-09-18 18:06 chenhx 14 | */ 15 | @Data 16 | public class ResourceContentDTO implements Serializable { 17 | private static final long serialVersionUID = 4507919213311807189L; 18 | 19 | /** 20 | * 资源描述与内容 21 | */ 22 | private String content; 23 | /** 24 | * 资源token 25 | */ 26 | private String resourceToken; 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/dto/ResourceSubjectDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.dto; 6 | 7 | import lombok.Data; 8 | 9 | import java.io.Serializable; 10 | 11 | /** 12 | * @author chenhx 13 | * @version ResourceSubjectDTO.java, v 0.1 2019-09-25 00:42 chenhx 14 | */ 15 | @Data 16 | public class ResourceSubjectDTO implements Serializable { 17 | private Integer id; 18 | /** 19 | * 专题名 20 | */ 21 | private String name; 22 | /** 23 | * 专题封面图片地址 24 | */ 25 | private String imageUrl; 26 | /** 27 | * 专题描述 28 | */ 29 | private String description; 30 | } 31 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/dto/ResourceTypeDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.dto; 6 | 7 | import lombok.Data; 8 | 9 | import java.io.Serializable; 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | 13 | /** 14 | * 分类 15 | * 16 | * @author chenhx 17 | * @version ResourceTypeDTO.java, v 0.1 2019-09-24 17:10 chenhx 18 | */ 19 | @Data 20 | public class ResourceTypeDTO implements Serializable { 21 | private Integer id; 22 | /** 23 | * 资源类别名称、UI,JQurys、免费专区 24 | */ 25 | private String name; 26 | 27 | private List resourceTypeDTOS = new ArrayList<>(); 28 | } 29 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/dto/TagsDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.dto; 6 | 7 | import lombok.Data; 8 | 9 | import java.io.Serializable; 10 | 11 | /** 12 | * 标签 13 | * 14 | * @author chenhx 15 | * @version TagsDTO.java, v 0.1 2019-09-19 10:55 chenhx 16 | */ 17 | @Data 18 | public class TagsDTO implements Serializable { 19 | 20 | private static final long serialVersionUID = -4277580515071868734L; 21 | 22 | 23 | /** 24 | * 标签名 25 | */ 26 | private String name; 27 | /** 28 | * 属于该标签的资源访问量 29 | */ 30 | private Integer visitTimes; 31 | 32 | private Integer id; 33 | } 34 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/dto/UsersCommentPageDTO.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | 8 | /** 9 | *

10 | * 用户评论表 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-21 15 | */ 16 | @Data 17 | public class UsersCommentPageDTO implements Serializable { 18 | private static final long serialVersionUID = 6062593546873890726L; 19 | /** 20 | * 用户id 21 | */ 22 | private Integer userId; 23 | /** 24 | * 资源id 25 | */ 26 | private Integer resourceId; 27 | /** 28 | * 父类的评论id 29 | */ 30 | private Integer pid; 31 | /** 32 | * 评论内容-过滤敏感词之后的 33 | */ 34 | private String details; 35 | 36 | /** 37 | * 评论的用户名 38 | */ 39 | private String username; 40 | 41 | /** 42 | * 创建时间 43 | */ 44 | private Date createTime; 45 | } 46 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/dto/UsersCookieDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.dto; 6 | 7 | import lombok.Data; 8 | 9 | import java.io.Serializable; 10 | 11 | /** 12 | * 存储在客户端的用户信息 13 | * 14 | * @author chenhx 15 | * @version UsersCookieDTO.java, v 0.1 2019-09-17 15:03 chenhx 16 | */ 17 | @Data 18 | public class UsersCookieDTO implements Serializable { 19 | private static final long serialVersionUID = -1567047698256969332L; 20 | /** 21 | * 用户名 22 | */ 23 | private String username; 24 | /** 25 | * 加密规则看代码 26 | */ 27 | private String token; 28 | 29 | /** 30 | * 毫秒 31 | */ 32 | private Long time; 33 | } 34 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/dto/UsersFocusPageDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.dto; 6 | 7 | import lombok.Data; 8 | 9 | import java.io.Serializable; 10 | 11 | /** 12 | * @author chenhx 13 | * @version UsersFocusPageDTO.java, v 0.1 2019-09-20 17:56 chenhx 14 | */ 15 | @Data 16 | public class UsersFocusPageDTO implements Serializable { 17 | 18 | private static final long serialVersionUID = 714752209570514626L; 19 | 20 | 21 | /** 22 | * 用户主页图片地址-默认值为默认图片的地址 23 | */ 24 | private String headImage; 25 | 26 | /** 27 | * 用户名(唯一而且不能有中文)-用户可以在注册后修改,修改一次90U币 28 | */ 29 | private String username; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/email/SendEmail.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.email; 2 | 3 | /** 4 | * Created with IntelliJ IDEA. 5 | * User: 陈浩翔. 6 | * Date: 2017/3/15. 7 | * Time: 下午 12:20. 8 | * Explain:用户发送邮件必须实现的接口 9 | */ 10 | public interface SendEmail { 11 | /** 12 | * 验证码 13 | * 14 | * @return 15 | */ 16 | String getCode(); 17 | 18 | /** 19 | * 用户的昵称 20 | * 21 | * @return 22 | */ 23 | String getName(); 24 | 25 | /** 26 | * 用户的邮箱,也就是收件邮箱 27 | * 28 | * @return 29 | */ 30 | String getEmail(); 31 | } 32 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/email/SendPayCheckEmail.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.email; 2 | 3 | /** 4 | * Created with IntelliJ IDEA. 5 | * User: 陈浩翔. 6 | * Date: 2017/3/15. 7 | * Time: 下午 12:20. 8 | * Explain:用户发送邮件必须实现的接口 9 | */ 10 | public interface SendPayCheckEmail { 11 | /** 12 | * 收件邮箱 13 | * 14 | * @return 15 | */ 16 | String getEmail(); 17 | 18 | /** 19 | * 获取URL 20 | * 21 | * @return 22 | */ 23 | String getUrl(); 24 | 25 | /** 26 | * 用户信息 27 | * 28 | * @return 29 | */ 30 | String getUserInfo(); 31 | 32 | /** 33 | * 支付信息 34 | * 35 | * @return 36 | */ 37 | String getPay(); 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/entity/IpEntity.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.uifuture.ssm.base.BaseEntity; 5 | import lombok.Data; 6 | import lombok.EqualsAndHashCode; 7 | import lombok.experimental.Accessors; 8 | 9 | /** 10 | *

11 | * 用户ip表 12 | *

13 | * 14 | * @author chenhx 15 | * @since 2019-09-19 16 | */ 17 | @Data 18 | @EqualsAndHashCode(callSuper = true) 19 | @Accessors(chain = true) 20 | @TableName("ip") 21 | public class IpEntity extends BaseEntity { 22 | 23 | public static final String USER_ID = "user_id"; 24 | public static final String IP = "ip"; 25 | private static final long serialVersionUID = 1L; 26 | /** 27 | * 用户id 28 | */ 29 | private Integer userId; 30 | /** 31 | * ip地址 32 | */ 33 | private String ip; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/entity/PayTypeEntity.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.uifuture.ssm.base.BaseEntity; 5 | import lombok.Data; 6 | import lombok.EqualsAndHashCode; 7 | import lombok.experimental.Accessors; 8 | 9 | /** 10 | *

11 | * 支付类型表。 12 | *

13 | * 14 | * @author chenhx 15 | * @since 2019-11-06 16 | */ 17 | @Data 18 | @EqualsAndHashCode(callSuper = true) 19 | @Accessors(chain = true) 20 | @TableName("pay_type") 21 | public class PayTypeEntity extends BaseEntity { 22 | 23 | private static final long serialVersionUID = 1L; 24 | 25 | /** 26 | * 支付类型名称 例如:支付宝支付,微信支付,网银支付等 27 | */ 28 | private String name; 29 | 30 | /** 31 | * 支付类型英文名,唯一 32 | */ 33 | private String enName; 34 | 35 | 36 | public static final String NAME = "name"; 37 | 38 | public static final String EN_NAME = "en_name"; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/entity/RResourceSubjectEntity.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.uifuture.ssm.base.BaseEntity; 5 | import lombok.Data; 6 | import lombok.EqualsAndHashCode; 7 | import lombok.experimental.Accessors; 8 | 9 | /** 10 | *

11 | * 资源与专题关系表。 12 | *

13 | * 14 | * @author chenhx 15 | * @since 2019-09-18 16 | */ 17 | @Data 18 | @EqualsAndHashCode(callSuper = true) 19 | @Accessors(chain = true) 20 | @TableName("r_resource_subject") 21 | public class RResourceSubjectEntity extends BaseEntity { 22 | 23 | public static final String RESOURCE_ID = "resource_id"; 24 | public static final String SUBJECT_ID = "subject_id"; 25 | private static final long serialVersionUID = 1L; 26 | /** 27 | * 资源表id 28 | */ 29 | private Integer resourceId; 30 | /** 31 | * 专题表id 32 | */ 33 | private Integer subjectId; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/entity/RResourceTagsEntity.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.uifuture.ssm.base.BaseEntity; 5 | import lombok.Data; 6 | import lombok.EqualsAndHashCode; 7 | import lombok.experimental.Accessors; 8 | 9 | /** 10 | *

11 | * 资源标签关系表。 12 | *

13 | * 14 | * @author chenhx 15 | * @since 2019-09-24 16 | */ 17 | @Data 18 | @EqualsAndHashCode(callSuper = true) 19 | @Accessors(chain = true) 20 | @TableName("r_resource_tags") 21 | public class RResourceTagsEntity extends BaseEntity { 22 | 23 | public static final String RESOURCE_ID = "resource_id"; 24 | public static final String TAGS_ID = "tags_id"; 25 | private static final long serialVersionUID = 1L; 26 | /** 27 | * 资源表id 28 | */ 29 | private Integer resourceId; 30 | /** 31 | * 标签表id 32 | */ 33 | private Integer tagsId; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/entity/RResourceTypeEntity.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.uifuture.ssm.base.BaseEntity; 5 | import lombok.Data; 6 | import lombok.EqualsAndHashCode; 7 | import lombok.experimental.Accessors; 8 | 9 | /** 10 | *

11 | * 资源与资源分类关系表 12 | *

13 | * 14 | * @author chenhx 15 | * @since 2019-09-18 16 | */ 17 | @Data 18 | @EqualsAndHashCode(callSuper = true) 19 | @Accessors(chain = true) 20 | @TableName("r_resource_type") 21 | public class RResourceTypeEntity extends BaseEntity { 22 | 23 | public static final String RESOURCE_ID = "resource_id"; 24 | public static final String RESOURCE_TYPE_ID = "resource_type_id"; 25 | private static final long serialVersionUID = 1L; 26 | /** 27 | * 资源id 28 | */ 29 | private Integer resourceId; 30 | /** 31 | * 资源分类id 32 | */ 33 | private Integer resourceTypeId; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/entity/RUsersCollectionsEntity.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.uifuture.ssm.base.BaseEntity; 5 | import lombok.Data; 6 | import lombok.EqualsAndHashCode; 7 | import lombok.experimental.Accessors; 8 | 9 | /** 10 | *

11 | * 用户收藏资源相关表。 12 | *

13 | * 14 | * @author chenhx 15 | * @since 2019-09-21 16 | */ 17 | @Data 18 | @EqualsAndHashCode(callSuper = true) 19 | @Accessors(chain = true) 20 | @TableName("r_users_collections") 21 | public class RUsersCollectionsEntity extends BaseEntity { 22 | 23 | public static final String USER_ID = "user_id"; 24 | public static final String RESOURCE_ID = "resource_id"; 25 | private static final long serialVersionUID = 1L; 26 | /** 27 | * 用户id 28 | */ 29 | private Integer userId; 30 | /** 31 | * 资源id 32 | */ 33 | private Integer resourceId; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/entity/ResourceContentEntity.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.uifuture.ssm.base.BaseEntity; 5 | import lombok.Data; 6 | import lombok.EqualsAndHashCode; 7 | import lombok.experimental.Accessors; 8 | 9 | /** 10 | *

11 | * 12 | *

13 | * 14 | * @author chenhx 15 | * @since 2019-09-18 16 | */ 17 | @Data 18 | @EqualsAndHashCode(callSuper = true) 19 | @Accessors(chain = true) 20 | @TableName("resource_content") 21 | public class ResourceContentEntity extends BaseEntity { 22 | 23 | public static final String CONTENT = "content"; 24 | public static final String RESOURCE_TOKEN = "resource_token"; 25 | private static final long serialVersionUID = 1L; 26 | /** 27 | * 资源描述与内容 28 | */ 29 | private String content; 30 | /** 31 | * 资源token 32 | */ 33 | private String resourceToken; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/entity/SensitiveWordEntity.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.uifuture.ssm.base.BaseEntity; 5 | import lombok.Data; 6 | import lombok.EqualsAndHashCode; 7 | import lombok.experimental.Accessors; 8 | 9 | /** 10 | *

11 | * 敏感词 12 | *

13 | * 14 | * @author chenhx 15 | * @since 2019-09-23 16 | */ 17 | @Data 18 | @EqualsAndHashCode(callSuper = true) 19 | @Accessors(chain = true) 20 | @TableName("sensitive_word") 21 | public class SensitiveWordEntity extends BaseEntity { 22 | 23 | public static final String WORD = "word"; 24 | private static final long serialVersionUID = 1L; 25 | /** 26 | * 敏感词 27 | */ 28 | private String word; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/entity/StopWordEntity.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.uifuture.ssm.base.BaseEntity; 5 | import lombok.Data; 6 | import lombok.EqualsAndHashCode; 7 | import lombok.experimental.Accessors; 8 | 9 | /** 10 | *

11 | * 敏感词过滤之-停顿词 12 | *

13 | * 14 | * @author chenhx 15 | * @since 2019-09-23 16 | */ 17 | @Data 18 | @EqualsAndHashCode(callSuper = true) 19 | @Accessors(chain = true) 20 | @TableName("stop_word") 21 | public class StopWordEntity extends BaseEntity { 22 | 23 | public static final String WORD = "word"; 24 | private static final long serialVersionUID = 1L; 25 | /** 26 | * 停顿词 27 | */ 28 | private String word; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/entity/TagsEntity.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.uifuture.ssm.base.BaseEntity; 5 | import lombok.Data; 6 | import lombok.EqualsAndHashCode; 7 | import lombok.experimental.Accessors; 8 | 9 | /** 10 | *

11 | * 标签表。 12 | *

13 | * 14 | * @author chenhx 15 | * @since 2019-09-18 16 | */ 17 | @Data 18 | @EqualsAndHashCode(callSuper = true) 19 | @Accessors(chain = true) 20 | @TableName("tags") 21 | public class TagsEntity extends BaseEntity { 22 | 23 | public static final String NAME = "name"; 24 | public static final String VISIT_TIMES = "visit_times"; 25 | private static final long serialVersionUID = 1L; 26 | /** 27 | * 标签名 28 | */ 29 | private String name; 30 | /** 31 | * 属于该标签的资源访问量 32 | */ 33 | private Integer visitTimes; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/entity/UsersFocusEntity.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.uifuture.ssm.base.BaseEntity; 5 | import lombok.Data; 6 | import lombok.EqualsAndHashCode; 7 | import lombok.experimental.Accessors; 8 | 9 | /** 10 | *

11 | * 用户关注表 12 | *

13 | * 14 | * @author chenhx 15 | * @since 2019-09-19 16 | */ 17 | @Data 18 | @EqualsAndHashCode(callSuper = true) 19 | @Accessors(chain = true) 20 | @TableName("users_focus") 21 | public class UsersFocusEntity extends BaseEntity { 22 | 23 | public static final String USER_ID = "user_id"; 24 | public static final String FOCUSED_USER_ID = "focused_user_id"; 25 | private static final long serialVersionUID = 1L; 26 | /** 27 | * 用户id-关注者id 28 | */ 29 | private Integer userId; 30 | /** 31 | * 被关注者的id 32 | */ 33 | private Integer focusedUserId; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/exception/CacheException.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.exception; 2 | 3 | import com.uifuture.ssm.base.BaseException; 4 | import com.uifuture.ssm.enums.ResultCodeEnum; 5 | 6 | public class CacheException extends BaseException { 7 | 8 | public CacheException(Integer code, String message) { 9 | super(code, message); 10 | } 11 | 12 | public CacheException(ResultCodeEnum resultCodeEnum) { 13 | super(resultCodeEnum.getValue(), resultCodeEnum.getName()); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/exception/CheckoutException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.exception; 6 | 7 | import com.uifuture.ssm.base.BaseException; 8 | import com.uifuture.ssm.enums.ResultCodeEnum; 9 | 10 | /** 11 | * 校验异常 12 | * 13 | * @author chenhx 14 | * @version CheckoutException.java, v 0.1 2019-09-20 16:48 chenhx 15 | */ 16 | public class CheckoutException extends BaseException { 17 | 18 | 19 | public CheckoutException(Integer code, String message) { 20 | super(code, message); 21 | } 22 | 23 | public CheckoutException(ResultCodeEnum resultCodeEnum) { 24 | super(resultCodeEnum.getValue(), resultCodeEnum.getName()); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/exception/CommonException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.exception; 6 | 7 | import com.uifuture.ssm.base.BaseException; 8 | import com.uifuture.ssm.enums.ResultCodeEnum; 9 | 10 | /** 11 | * @author chenhx 12 | * @version CommonException.java, v 0.1 2019-09-14 11:43 chenhx 13 | */ 14 | public class CommonException extends BaseException { 15 | 16 | 17 | public CommonException(Integer code, String message) { 18 | super(code, message); 19 | } 20 | 21 | public CommonException(ResultCodeEnum resultCodeEnum) { 22 | super(resultCodeEnum.getValue(), resultCodeEnum.getName()); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/exception/ParameterException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.exception; 6 | 7 | import com.uifuture.ssm.base.BaseException; 8 | import com.uifuture.ssm.enums.ResultCodeEnum; 9 | 10 | /** 11 | * @author chenhx 12 | * @version ParameterException.java, v 0.1 2019-11-07 20:20 chenhx 13 | */ 14 | public class ParameterException extends BaseException { 15 | 16 | 17 | public ParameterException(Integer code, String message) { 18 | super(code, message); 19 | } 20 | 21 | public ParameterException(ResultCodeEnum resultCodeEnum) { 22 | super(resultCodeEnum.getValue(), resultCodeEnum.getName()); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/exception/ServiceException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.exception; 6 | 7 | import com.uifuture.ssm.base.BaseException; 8 | import com.uifuture.ssm.enums.ResultCodeEnum; 9 | 10 | /** 11 | * @author chenhx 12 | * @version ServiceException.java, v 0.1 2019-09-16 16:08 chenhx 13 | */ 14 | public class ServiceException extends BaseException { 15 | 16 | 17 | public ServiceException(Integer code, String message) { 18 | super(code, message); 19 | } 20 | 21 | public ServiceException(ResultCodeEnum resultCodeEnum) { 22 | super(resultCodeEnum.getValue(), resultCodeEnum.getName()); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/mapper/IpDetailsMapper.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.uifuture.ssm.entity.IpDetailsEntity; 5 | 6 | /** 7 | *

8 | * ip详情表-通过数据中心查找ip查找出来的 Mapper 接口 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-09-19 13 | */ 14 | public interface IpDetailsMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/mapper/IpMapper.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.uifuture.ssm.entity.IpEntity; 5 | 6 | /** 7 | *

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

10 | * 11 | * @author chenhx 12 | * @since 2019-09-19 13 | */ 14 | public interface IpMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/mapper/PayTypeMapper.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.uifuture.ssm.entity.PayTypeEntity; 5 | 6 | /** 7 | *

8 | * 支付类型表。 Mapper 接口 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-11-06 13 | */ 14 | public interface PayTypeMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/mapper/RResourceSubjectMapper.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.uifuture.ssm.entity.RResourceSubjectEntity; 5 | 6 | /** 7 | *

8 | * 资源与专题关系表。 Mapper 接口 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-09-18 13 | */ 14 | public interface RResourceSubjectMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/mapper/RResourceTagsMapper.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.uifuture.ssm.entity.RResourceTagsEntity; 5 | 6 | /** 7 | *

8 | * 资源标签关系表。 Mapper 接口 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-09-24 13 | */ 14 | public interface RResourceTagsMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/mapper/RResourceTypeMapper.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.uifuture.ssm.entity.RResourceTypeEntity; 5 | 6 | /** 7 | *

8 | * 资源与资源分类关系表 Mapper 接口 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-09-18 13 | */ 14 | public interface RResourceTypeMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/mapper/RUsersCollectionsMapper.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.uifuture.ssm.entity.RUsersCollectionsEntity; 5 | 6 | /** 7 | *

8 | * 用户收藏资源相关表。 Mapper 接口 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-09-21 13 | */ 14 | public interface RUsersCollectionsMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/mapper/ResourceContentMapper.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.uifuture.ssm.entity.ResourceContentEntity; 5 | 6 | /** 7 | *

8 | * Mapper 接口 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-09-18 13 | */ 14 | public interface ResourceContentMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/mapper/ResourceMapper.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.uifuture.ssm.entity.ResourceEntity; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | /** 8 | *

9 | * 资源表。 Mapper 接口 10 | *

11 | * 12 | * @author chenhx 13 | * @since 2019-09-18 14 | */ 15 | public interface ResourceMapper extends BaseMapper { 16 | 17 | /** 18 | * 增加属性的值 19 | * 20 | * @param 21 | */ 22 | void addParamByToken(@Param("token") String token, @Param("param") String param, @Param("number") Integer number); 23 | } 24 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/mapper/ResourceSubjectMapper.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.uifuture.ssm.entity.ResourceSubjectEntity; 5 | 6 | /** 7 | *

8 | * 资源专题表 Mapper 接口 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-09-18 13 | */ 14 | public interface ResourceSubjectMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/mapper/ResourceTypeMapper.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.uifuture.ssm.entity.ResourceTypeEntity; 5 | 6 | /** 7 | *

8 | * 资源分类表。 Mapper 接口 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-09-18 13 | */ 14 | public interface ResourceTypeMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/mapper/SensitiveWordMapper.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.uifuture.ssm.entity.SensitiveWordEntity; 5 | 6 | /** 7 | *

8 | * 敏感词 Mapper 接口 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-09-23 13 | */ 14 | public interface SensitiveWordMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/mapper/StopWordMapper.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.uifuture.ssm.entity.StopWordEntity; 5 | 6 | /** 7 | *

8 | * 敏感词过滤之-停顿词 Mapper 接口 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-09-23 13 | */ 14 | public interface StopWordMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/mapper/TagsMapper.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.uifuture.ssm.entity.TagsEntity; 5 | 6 | /** 7 | *

8 | * 标签表。 Mapper 接口 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-09-18 13 | */ 14 | public interface TagsMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/mapper/UsersCommentMapper.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.uifuture.ssm.entity.UsersCommentEntity; 5 | 6 | /** 7 | *

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

10 | * 11 | * @author chenhx 12 | * @since 2019-09-21 13 | */ 14 | public interface UsersCommentMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/mapper/UsersFocusMapper.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.uifuture.ssm.entity.UsersFocusEntity; 5 | 6 | /** 7 | *

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

10 | * 11 | * @author chenhx 12 | * @since 2019-09-19 13 | */ 14 | public interface UsersFocusMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/mapper/UsersMapper.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.uifuture.ssm.entity.UsersEntity; 5 | import org.apache.ibatis.annotations.Param; 6 | import org.apache.ibatis.annotations.Update; 7 | 8 | /** 9 | *

10 | * 用户表 Mapper 接口 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-14 15 | */ 16 | public interface UsersMapper extends BaseMapper { 17 | 18 | /** 19 | * 操作UB 20 | * 21 | * @param usersId 22 | * @param ub 23 | */ 24 | @Update("update users set ub=ub+#{ub} where id=#{usersId}") 25 | void operateUB(@Param("usersId") Integer usersId, @Param("ub") Integer ub); 26 | } 27 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/mapper/UsersPayMapper.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.uifuture.ssm.entity.UsersPayEntity; 5 | 6 | /** 7 | *

8 | * 用户支付信息详情表 Mapper 接口 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-11-07 13 | */ 14 | public interface UsersPayMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/mapper/UsersRechargeUbMapper.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.uifuture.ssm.entity.UsersRechargeUbEntity; 5 | 6 | /** 7 | *

8 | * 用户充值U币表,存放用户充值U币信息。 Mapper 接口 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-11-07 13 | */ 14 | public interface UsersRechargeUbMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/redis/Client.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.redis; 2 | 3 | import com.uifuture.ssm.redis.result.CacheResult; 4 | 5 | public interface Client { 6 | 7 | /** 8 | * 返回实际的缓存过期时间 9 | * 10 | * @param key 11 | * @param obj 12 | * @param expire 13 | * @return 14 | */ 15 | public void set(String key, Object obj, int expire); 16 | 17 | public CacheResult get(String key); 18 | 19 | public void delete(String key); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/redis/config/ConnConfig.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.redis.config; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ConnConfig { 7 | /** 8 | * 地址 9 | */ 10 | private String host; 11 | 12 | /** 13 | * 端口 14 | */ 15 | private Integer port; 16 | 17 | /** 18 | * 密码 19 | */ 20 | private String password; 21 | 22 | /** 23 | * 项目名称 24 | */ 25 | private String app; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/redis/listener/MessageData.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.redis.listener; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class MessageData { 7 | 8 | private String app; 9 | 10 | private String key; 11 | 12 | private String data; 13 | 14 | private String clazz; 15 | 16 | private int expire; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/req/UsersCommentReq.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.req; 2 | 3 | import lombok.Data; 4 | import org.hibernate.validator.constraints.Length; 5 | 6 | import javax.validation.constraints.NotEmpty; 7 | import java.io.Serializable; 8 | 9 | /** 10 | *

11 | * 用户评论 12 | *

13 | * 14 | * @author chenhx 15 | * @since 2019-09-21 16 | */ 17 | @Data 18 | public class UsersCommentReq implements Serializable { 19 | private static final long serialVersionUID = 4854935929191869821L; 20 | /** 21 | * 资源id 22 | */ 23 | @NotEmpty(message = "评论的资源不能为空") 24 | private Integer resourceId; 25 | 26 | /** 27 | * 父类的评论id 28 | */ 29 | private Integer pid = 0; 30 | /** 31 | * 评论id 32 | */ 33 | private Integer commentId = 0; 34 | /** 35 | * 实际的评论内容 36 | */ 37 | @NotEmpty(message = "评论内容不能为空") 38 | @Length(max = 1000, message = "评论内容最长1000个字符") 39 | private String realDetails; 40 | } 41 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/service/IpDetailsService.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.uifuture.ssm.entity.IpDetailsEntity; 5 | 6 | /** 7 | *

8 | * ip详情表-通过数据中心查找ip查找出来的 服务类 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-09-19 13 | */ 14 | public interface IpDetailsService extends IService { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/service/IpService.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.uifuture.ssm.entity.IpEntity; 5 | 6 | /** 7 | *

8 | * 用户ip表 服务类 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-09-19 13 | */ 14 | public interface IpService extends IService { 15 | 16 | /** 17 | * 新增IP记录 18 | * 19 | * @param ipAddress ip 20 | * @param userId 用户id 21 | */ 22 | void saveIp(String ipAddress, Integer userId); 23 | } 24 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/service/PayTypeService.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.uifuture.ssm.entity.PayTypeEntity; 5 | 6 | /** 7 | *

8 | * 支付类型表。 服务类 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-11-06 13 | */ 14 | public interface PayTypeService extends IService { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/service/RResourceSubjectService.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.service; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | import com.uifuture.ssm.bo.RResourceSubjectQueryBo; 6 | import com.uifuture.ssm.entity.RResourceSubjectEntity; 7 | 8 | /** 9 | *

10 | * 资源与专题关系表。 服务类 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-18 15 | */ 16 | public interface RResourceSubjectService extends IService { 17 | 18 | /** 19 | * 分页查询 20 | * 21 | * @param pageNum 22 | * @param pageSize 23 | * @param rResourceSubjectQueryBo 24 | * @return 25 | */ 26 | IPage getPage(Integer pageNum, Integer pageSize, RResourceSubjectQueryBo rResourceSubjectQueryBo); 27 | } 28 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/service/RResourceTagsService.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.service; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | import com.uifuture.ssm.bo.RResourceTagsQueryBo; 6 | import com.uifuture.ssm.entity.RResourceTagsEntity; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | *

12 | * 资源标签关系表。 服务类 13 | *

14 | * 15 | * @author chenhx 16 | * @since 2019-09-24 17 | */ 18 | public interface RResourceTagsService extends IService { 19 | 20 | /** 21 | * 通过资源id查询标签 数据 22 | * 23 | * @param id 24 | * @return 25 | */ 26 | List listByResourceId(Integer id); 27 | 28 | /** 29 | * 分页查询 30 | * 31 | * @param pageNum 32 | * @param pageSize 33 | * @param rResourceTagsQueryBo 34 | * @return 35 | */ 36 | IPage getPage(Integer pageNum, Integer pageSize, RResourceTagsQueryBo rResourceTagsQueryBo); 37 | } 38 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/service/RResourceTypeService.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.service; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | import com.uifuture.ssm.bo.RResourceTypeQueryBo; 6 | import com.uifuture.ssm.entity.RResourceTypeEntity; 7 | 8 | /** 9 | *

10 | * 资源与资源分类关系表 服务类 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-18 15 | */ 16 | public interface RResourceTypeService extends IService { 17 | 18 | /** 19 | * 获取分页数据 20 | * 21 | * @param pageNum 22 | * @param pageSize 23 | * @param rResourceTypeQueryBo 24 | * @return 25 | */ 26 | IPage getPage(Integer pageNum, Integer pageSize, RResourceTypeQueryBo rResourceTypeQueryBo); 27 | } 28 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/service/ResourceContentService.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.uifuture.ssm.entity.ResourceContentEntity; 5 | 6 | /** 7 | *

8 | * 服务类 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-09-18 13 | */ 14 | public interface ResourceContentService extends IService { 15 | 16 | /** 17 | * 通过资源token获取资源 18 | * 19 | * @param token 20 | * @return 21 | */ 22 | ResourceContentEntity getByToken(String token); 23 | } 24 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/service/ResourceSubjectService.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.uifuture.ssm.entity.ResourceSubjectEntity; 5 | 6 | import java.util.Collection; 7 | 8 | /** 9 | *

10 | * 资源专题表 服务类 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-18 15 | */ 16 | public interface ResourceSubjectService extends IService { 17 | /** 18 | * 获取未删除的全部数据 19 | * 20 | * @return 21 | */ 22 | Collection listNoDelete(); 23 | } 24 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/service/ResourceTypeService.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.uifuture.ssm.entity.ResourceTypeEntity; 5 | 6 | import java.util.Collection; 7 | 8 | /** 9 | *

10 | * 资源分类表。 服务类 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-18 15 | */ 16 | public interface ResourceTypeService extends IService { 17 | 18 | /** 19 | * 获取未删除的所有数据 20 | * 21 | * @return 22 | */ 23 | Collection listNoDelete(); 24 | } 25 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/service/SensitiveWordService.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.uifuture.ssm.entity.SensitiveWordEntity; 5 | 6 | /** 7 | *

8 | * 敏感词 服务类 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-09-23 13 | */ 14 | public interface SensitiveWordService extends IService { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/service/StopWordService.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.uifuture.ssm.entity.StopWordEntity; 5 | 6 | /** 7 | *

8 | * 敏感词过滤之-停顿词 服务类 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-09-23 13 | */ 14 | public interface StopWordService extends IService { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/service/UsersCommentService.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.service; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | import com.uifuture.ssm.bo.UsersCommentQueryBo; 6 | import com.uifuture.ssm.entity.UsersCommentEntity; 7 | 8 | /** 9 | *

10 | * 用户评论表 服务类 11 | *

12 | * 13 | * @author chenhx 14 | * @since 2019-09-21 15 | */ 16 | public interface UsersCommentService extends IService { 17 | 18 | /** 19 | * 软删评论 20 | * 21 | * @param commentId 22 | */ 23 | void updateDeleteTimeById(Integer commentId); 24 | 25 | /** 26 | * 分页查询数据 27 | * 28 | * @param pageNum 29 | * @param pageSize 30 | * @param usersCommentQueryBo 31 | * @return 32 | */ 33 | IPage getPage(Integer pageNum, Integer pageSize, UsersCommentQueryBo usersCommentQueryBo); 34 | } 35 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/service/UsersRechargeUbService.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.uifuture.ssm.entity.UsersRechargeUbEntity; 5 | 6 | /** 7 | *

8 | * 用户充值U币表,存放用户充值U币信息。 服务类 9 | *

10 | * 11 | * @author chenhx 12 | * @since 2019-11-06 13 | */ 14 | public interface UsersRechargeUbService extends IService { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/service/impl/IpDetailsServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.service.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.uifuture.ssm.entity.IpDetailsEntity; 5 | import com.uifuture.ssm.mapper.IpDetailsMapper; 6 | import com.uifuture.ssm.service.IpDetailsService; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | *

11 | * ip详情表-通过数据中心查找ip查找出来的 服务实现类 12 | *

13 | * 14 | * @author chenhx 15 | * @since 2019-09-19 16 | */ 17 | @Service 18 | public class IpDetailsServiceImpl extends ServiceImpl implements IpDetailsService { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/service/impl/PayTypeServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.service.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.uifuture.ssm.entity.PayTypeEntity; 5 | import com.uifuture.ssm.mapper.PayTypeMapper; 6 | import com.uifuture.ssm.service.PayTypeService; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | *

11 | * 支付类型表。 服务实现类 12 | *

13 | * 14 | * @author chenhx 15 | * @since 2019-11-06 16 | */ 17 | @Service 18 | public class PayTypeServiceImpl extends ServiceImpl implements PayTypeService { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/service/impl/SensitiveWordServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.service.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.uifuture.ssm.entity.SensitiveWordEntity; 5 | import com.uifuture.ssm.mapper.SensitiveWordMapper; 6 | import com.uifuture.ssm.service.SensitiveWordService; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | *

11 | * 敏感词 服务实现类 12 | *

13 | * 14 | * @author chenhx 15 | * @since 2019-09-23 16 | */ 17 | @Service 18 | public class SensitiveWordServiceImpl extends ServiceImpl implements SensitiveWordService { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/service/impl/StopWordServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.service.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.uifuture.ssm.entity.StopWordEntity; 5 | import com.uifuture.ssm.mapper.StopWordMapper; 6 | import com.uifuture.ssm.service.StopWordService; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | *

11 | * 敏感词过滤之-停顿词 服务实现类 12 | *

13 | * 14 | * @author chenhx 15 | * @since 2019-09-23 16 | */ 17 | @Service 18 | public class StopWordServiceImpl extends ServiceImpl implements StopWordService { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/service/impl/UsersRechargeUbServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.uifuture.ssm.service.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.uifuture.ssm.entity.UsersRechargeUbEntity; 5 | import com.uifuture.ssm.mapper.UsersRechargeUbMapper; 6 | import com.uifuture.ssm.service.UsersRechargeUbService; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | *

11 | * 用户充值U币表,存放用户充值U币信息。 服务实现类 12 | *

13 | * 14 | * @author chenhx 15 | * @since 2019-11-06 16 | */ 17 | @Service 18 | public class UsersRechargeUbServiceImpl extends ServiceImpl implements UsersRechargeUbService { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/util/CollectionUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.util; 6 | 7 | import java.util.HashSet; 8 | import java.util.List; 9 | import java.util.Set; 10 | 11 | /** 12 | * @author chenhx 13 | * @version CollectionUtils.java, v 0.1 2019-09-18 15:50 chenhx 14 | */ 15 | public class CollectionUtils { 16 | 17 | /** 18 | * list集合转换为set 19 | * 20 | * @param list 21 | * @param 22 | * @return 23 | */ 24 | public static Set listToSet(List list) { 25 | Set set = new HashSet<>(); 26 | set.addAll(list); 27 | return set; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/java/com/uifuture/ssm/util/IteratorsUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.util; 6 | 7 | import java.util.Iterator; 8 | 9 | /** 10 | * @author chenhx 11 | * @version IteratorsUtils.java, v 0.1 2019-09-14 12:18 chenhx 12 | */ 13 | public class IteratorsUtils { 14 | 15 | 16 | public static T getFirst(Iterable iterable, T defaultValue) { 17 | return getNext(iterable.iterator(), defaultValue); 18 | } 19 | 20 | public static T getNext(Iterator iterator, T defaultValue) { 21 | return iterator.hasNext() ? iterator.next() : defaultValue; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/resources/application-aop.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/resources/application.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/resources/common.properties: -------------------------------------------------------------------------------- 1 | # 环境配置 2 | application.env=dev 3 | # cdn图片域名 4 | cdn.images.href=//ssm.****.com 5 | # 阿里云OSS 图片资源配置 阿里云账号的 6 | aliyun.oss.endpoint=oss-cn-hangzhou.aliyuncs.com 7 | # 阿里云账号的key 8 | aliyun.oss.access.key.id=**** 9 | # 阿里云账号的secret 10 | aliyun.oss.access.key.secret=**** 11 | # bucket名称 12 | aliyun.oss.bucket.img.name=**** 13 | #私钥 14 | alipay.private.key=**** 15 | #公钥 16 | alipay.public.key=**** 17 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/resources/config.properties: -------------------------------------------------------------------------------- 1 | driverClassName=com.mysql.jdbc.Driver 2 | # mysql8.0+ 3 | #driverClassName=com.mysql.cj.jdbc.Driver 4 | jdbc_url=jdbc:mysql://localhost:3306/uifuture?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8&remarks=true 5 | jdbc_username=4B1F1099FE3DCDEE0C4B5ED079322488 6 | jdbc_password=F48A25E5C6CFCE140FEB01FBB941AE93 7 | #jdbc_username=root 8 | #jdbc_password=12345678 9 | #初始化连接大小 10 | jdbc_init=50 11 | #连接池最小空闲 12 | jdbc_minIdle=20 13 | #获取连接最大等待时间 单位为毫秒 14 | jdbc_maxActive=60000 15 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/resources/email.properties: -------------------------------------------------------------------------------- 1 | # 邮件配置 2 | #邮箱地址 3 | email.mail.add=****@****.com 4 | # 发送人名称 5 | email.mail.name=**** 6 | # 邮箱密码 7 | email.mail.password=**** 8 | email.mail.port=465 9 | #服务器主机名 10 | email.mail.host=smtp.****.com 11 | # 协议 12 | email.mail.protocol=smtp 13 | # 主题 14 | email.subject=异常邮件通知 15 | email.index.mail.add=http://127.0.0.1:8080/ 16 | #客服邮箱 17 | email.service.mail=****@****.com 18 | 19 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/resources/mapper/IpMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | id, 18 | create_time, 19 | update_time, 20 | delete_time, 21 | user_id, ip 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/resources/mapper/PayTypeMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | id, 18 | create_time, 19 | update_time, 20 | delete_time, 21 | name, en_name 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/resources/mapper/RResourceSubjectMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | id, 18 | create_time, 19 | update_time, 20 | delete_time, 21 | resource_id, subject_id 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/resources/mapper/RResourceTagsMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | id, 18 | create_time, 19 | update_time, 20 | delete_time, 21 | resource_id, tags_id 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/resources/mapper/RResourceTypeMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | id, 18 | create_time, 19 | update_time, 20 | delete_time, 21 | resource_id, resource_type_id 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/resources/mapper/RUsersCollectionsMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | id, 18 | create_time, 19 | update_time, 20 | delete_time, 21 | user_id, resource_id 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/resources/mapper/ResourceContentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | id, 18 | create_time, 19 | update_time, 20 | delete_time, 21 | content, resource_token 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/resources/mapper/ResourceTypeMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | id, 19 | create_time, 20 | update_time, 21 | delete_time, 22 | name, pid,hierarchy 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/resources/mapper/SensitiveWordMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | id, 17 | word, 18 | create_time, 19 | update_time, 20 | delete_time, 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/resources/mapper/StopWordMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | id, 17 | word, 18 | create_time, 19 | update_time, 20 | delete_time, 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/resources/mapper/TagsMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | id, 18 | create_time, 19 | update_time, 20 | delete_time, 21 | name, visit_times 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/resources/mapper/UsersFocusMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | id, 18 | create_time, 19 | update_time, 20 | delete_time, 21 | user_id, focused_user_id 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/resources/mq.properties: -------------------------------------------------------------------------------- 1 | # 生产者,消费者,目前在一个项目,就不重新配置了 2 | aliyun.mq.uifuture.groupId=GID_uifuture_test 3 | aliyun.mq.uifuture.topicId=uifuture_topic_test 4 | aliyun.mq.uifuture.tag=uifuture_test 5 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/resources/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ssm-uifuture/src/main/resources/redis.properties: -------------------------------------------------------------------------------- 1 | ##访问地址 2 | redis.host=127.0.0.1 3 | ##访问端口 4 | redis.port=6379 5 | ##注意,如果没有password,此处不设置值,但这一项要保留 6 | redis.password= 7 | # redis库 8 | redis.database=0 9 | # 项目名称 10 | redis.app=ssm-uifuture 11 | -------------------------------------------------------------------------------- /ssm-uifuture/src/test/java/com/uifuture/ssm/BaseTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm; 6 | 7 | import org.junit.runner.RunWith; 8 | import org.springframework.test.context.ContextConfiguration; 9 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 10 | 11 | /** 12 | * @author chenhx 13 | * @version BaseTest.java, v 0.1 2019-09-13 09:26 chenhx 14 | */ 15 | @RunWith(SpringJUnit4ClassRunner.class) 16 | @ContextConfiguration(locations = {"classpath*:application-context.xml"}) 17 | public class BaseTest { 18 | } 19 | -------------------------------------------------------------------------------- /ssm-uifuture/src/test/java/com/uifuture/ssm/service/impl/UsersServiceImplTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * uifuture.com 3 | * Copyright (C) 2013-2019 All Rights Reserved. 4 | */ 5 | package com.uifuture.ssm.service.impl; 6 | 7 | import com.uifuture.ssm.BaseTest; 8 | import com.uifuture.ssm.service.UsersService; 9 | import lombok.extern.slf4j.Slf4j; 10 | import org.junit.Test; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | 13 | /** 14 | * @author chenhx 15 | * @version UsersServiceImplTest.java, v 0.1 2019-09-13 09:26 chenhx 16 | */ 17 | @Slf4j 18 | public class UsersServiceImplTest extends BaseTest { 19 | @Autowired 20 | private UsersService usersService; 21 | 22 | @Test 23 | public void list() { 24 | log.info("获取的数据:" + usersService.list()); 25 | } 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /ssm-uifuture/web/WEB-INF/templates/index.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | spring mvc 11 | 12 | 13 | 14 | 你好,世界 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /ssm-uifuture/web/WEB-INF/templates/test/login.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 登录测试 11 | 12 | 13 | 14 | <#if SESSION_USERS_LOGIN_INFO??> 15 | ${SESSION_USERS_LOGIN_INFO.username!''} 16 | 17 | 18 |
19 | 用户名: 20 | 密码: 21 | 22 |
23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ssm-uifuture/web/WEB-INF/templates/test/uploadFile.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 上传图片文件测试 11 | 12 | 13 | 14 | 图片文件上传测试:(最大50MB) 15 |
16 | File: 17 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /ssm-uifuture/web/WEB-INF/templates/test/uploadResources.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 上传资源文件测试 11 | 12 | 13 | 14 | 资源文件上传测试:(最大50MB) 15 |
16 | File: 17 | 18 |
19 | 20 | 21 | --------------------------------------------------------------------------------