├── .gitignore ├── LICENSE ├── README.md ├── application1.yml ├── auth-common ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── platform │ └── authcommon │ ├── api │ └── OrderApi.java │ ├── base │ ├── BaseEntity.java │ └── BaseReq.java │ ├── common │ ├── AccountTypeEnum.java │ ├── Constant.java │ ├── ErrorCode.java │ ├── OrderStatusEnum.java │ ├── Result.java │ ├── ResultCode.java │ ├── StatusEnum.java │ ├── TokenConstant.java │ ├── TransTypeEnum.java │ └── aop │ │ ├── LockType.java │ │ ├── annotation │ │ ├── DistributedLock.java │ │ └── RestMapping.java │ │ └── aspect │ │ └── DistributedLockAspect.java │ ├── config │ ├── AppHandlerMapping.java │ ├── AsyncPoolConfig.java │ ├── RedisConfig.java │ ├── RedisUtils.java │ └── ThreadPoolConfig.java │ ├── dto │ ├── AuthConstant.java │ ├── LoginDto.java │ ├── MessageConstant.java │ ├── OrderDto.java │ ├── RedisConstant.java │ └── UserDto.java │ ├── exception │ ├── AppException.java │ ├── AppExceptionHandler.java │ └── WebExceptionHandler.java │ ├── filter │ └── hold.md │ ├── model │ ├── Customer.java │ ├── FilterRescorer.java │ ├── MahoutUtils.java │ ├── ModelTest.java │ ├── Recommend.java │ ├── RecommendFactory.java │ ├── Test01.java │ └── hold.md │ └── utils │ └── IdGenUtils.java ├── auth-gateway ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── platform │ │ └── authgateway │ │ ├── AuthGatewayApplication.java │ │ ├── authorization │ │ └── AuthorizationManager.java │ │ ├── component │ │ ├── RestAuthenticationEntryPoint.java │ │ └── RestfulAccessDeniedHandler.java │ │ ├── config │ │ ├── GateWayConfig.java │ │ ├── GatewayConfigServiceConfig.java │ │ ├── GatewayRouteConfig.java │ │ ├── GatewayRouteInitConfig.java │ │ ├── IgnoreUrlsConfig.java │ │ ├── NacosRouteDefinitionRepository.java │ │ ├── RedisRepositoryConfig.java │ │ ├── ResourceServerConfig.java │ │ └── RouteService.java │ │ ├── filter │ │ ├── AppGatewayFilter.java │ │ ├── AuthGlobalFilter.java │ │ ├── IgnoreUrlsRemoveJwtFilter.java │ │ └── NacosConfigListener.java │ │ └── service │ │ └── RouteServiceImpl.java │ └── resources │ └── application.yml ├── auth-mpg ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── platform │ │ │ └── authmpg │ │ │ ├── AuthMpgApplication.java │ │ │ ├── dto │ │ │ └── UserDto.java │ │ │ └── web │ │ │ └── IndexController.java │ └── resources │ │ ├── application.yml │ │ ├── hold.md │ │ └── tpl │ │ ├── entity.java.ftl │ │ └── mapper.xml.ftl │ └── test │ └── java │ └── com │ └── platform │ └── authmpg │ ├── AppTemplateEngine.java │ ├── AuthMpgApplicationTests.java │ └── CodeGenerateMPG.java ├── auth-server ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── platform │ │ └── authserver │ │ ├── AuthServerApplication.java │ │ ├── config │ │ ├── AppWebStaticConfig.java │ │ ├── JwtTokenEnhancer.java │ │ ├── OAuth2AuthorizationServer.java │ │ ├── RedisRepositoryConfig.java │ │ └── WebSecurityConfig.java │ │ ├── constant │ │ ├── MessageConstant.java │ │ └── RedisConstant.java │ │ ├── domain │ │ ├── Oauth2TokenDto.java │ │ ├── SecurityUser.java │ │ └── UserDTO.java │ │ ├── entity │ │ └── User.java │ │ ├── exception │ │ ├── OAuthServerWebResponseExceptionTranslator.java │ │ └── Oauth2ExceptionHandler.java │ │ ├── mapper │ │ └── UserMapper.java │ │ ├── service │ │ ├── ResourceService.java │ │ └── UserServiceImpl.java │ │ └── web │ │ ├── AuthController.java │ │ ├── GrantController.java │ │ ├── IndexController.java │ │ └── KeyPairController.java │ └── resources │ ├── application.yml │ ├── jwt.jks │ ├── static │ ├── css │ │ └── login.css │ └── hold.md │ └── templates │ ├── confirm.ftl │ ├── grant.ftl │ └── login.ftl ├── data-cleaning ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── platform │ │ └── migrate │ │ ├── DataCleaningApplication.java │ │ ├── dto │ │ └── UserDto.java │ │ ├── flink │ │ ├── CustomSink.java │ │ └── MySqlEventListener.java │ │ ├── utils │ │ └── ShortUtils.java │ │ └── web │ │ ├── IndexController.java │ │ └── ShortController.java │ └── resources │ └── application.yml ├── data.txt ├── data ├── 20221127182040.png ├── 20221127182114.png ├── 20221127182150.png ├── 20221127182256.png ├── 20221127182324.png ├── 20221127182520.png ├── 20221127182552.png └── doc.md ├── doc.md ├── doc ├── 0306.md ├── 0307.md ├── doc.md ├── doc20240228.md ├── protobuf_learn.md ├── python_learn.md ├── sftp_create.md └── springboot_p6spy.md ├── git-flow-plus.config ├── order-server ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── platform │ │ └── orderserver │ │ ├── OrderServerApplication.java │ │ ├── business │ │ ├── PayBusiness.java │ │ └── WxPayBusiness.java │ │ ├── config │ │ ├── AliPayConfig.java │ │ ├── AppKeyConfig.java │ │ ├── AppRequestIdGenerator.java │ │ ├── AsyncPoolConfig.java │ │ ├── PriPubKeyConfig.java │ │ └── WeixinConfig.java │ │ ├── controller │ │ ├── AlipayController.java │ │ ├── AppController.java │ │ ├── BusController.java │ │ └── OrderController.java │ │ ├── dto │ │ ├── DataReq.java │ │ ├── OrderInfoDto.java │ │ ├── OrderInfoReq.java │ │ ├── PayDto.java │ │ ├── PayResp.java │ │ └── RefundInfoDto.java │ │ ├── entity │ │ └── Order.java │ │ ├── flownode │ │ ├── AppFlowContext.java │ │ ├── AppFlowDto.java │ │ ├── FlowExecutorService.java │ │ └── app │ │ │ ├── GrantScore.java │ │ │ ├── PrepareTrade.java │ │ │ ├── SendEmail.java │ │ │ ├── SendMq.java │ │ │ └── SendPhone.java │ │ ├── listener │ │ └── MysqlBinLogListener.java │ │ ├── mapper │ │ └── OrderMapper.java │ │ ├── service │ │ ├── OrderService.java │ │ └── impl │ │ │ └── OrderServiceImpl.java │ │ ├── stragey │ │ ├── AbstractAppBusiness.java │ │ ├── AlipayAppBusiness.java │ │ ├── BaseBusiness.java │ │ ├── PayContext.java │ │ ├── UnionPayAppBusiness.java │ │ └── WeixinAppBusiness.java │ │ ├── task │ │ └── CloseOrderTask.java │ │ └── utils │ │ ├── BossTest.java │ │ ├── GsonUtil.java │ │ ├── IdGenUtils.java │ │ ├── OceanBaseTest.java │ │ ├── PayTypeEnum.java │ │ ├── RSAUtils.java │ │ ├── ResponseUtils.java │ │ ├── Sm2Utils.java │ │ ├── WxApiType.java │ │ ├── WxNotifyType.java │ │ └── ZxingUtils.java │ └── resources │ ├── apiclient_key.pem │ ├── application-dev.yml │ ├── application.yml │ ├── liteflow │ └── test_flow.el.xml │ ├── mapper │ └── BoardMapper.xml │ └── pub_pri_key.properties ├── pom.xml ├── pom1.xml ├── product-server ├── pom.xml ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── platform │ │ │ │ └── productserver │ │ │ │ ├── ProductServerApplication.java │ │ │ │ ├── business │ │ │ │ ├── RedPkgBusiness.java │ │ │ │ └── StockBusiness.java │ │ │ │ ├── config │ │ │ │ ├── AppBusinessAspect.java │ │ │ │ ├── AppInterceptor.java │ │ │ │ ├── AppRequestInterceptor.java │ │ │ │ ├── ApplicationContextHolder.java │ │ │ │ ├── AuthConfig.java │ │ │ │ ├── AuthenticationFilter.java │ │ │ │ ├── Business.java │ │ │ │ ├── MyMetaObjectHandler.java │ │ │ │ └── ProductAppConfig.java │ │ │ │ ├── dto │ │ │ │ ├── AccountDto.java │ │ │ │ ├── BaseNode.java │ │ │ │ ├── BatchTradeDto.java │ │ │ │ ├── BatchTradeResp.java │ │ │ │ ├── BatchUserTradeDto.java │ │ │ │ ├── BusinessDto.java │ │ │ │ ├── DataNode.java │ │ │ │ ├── FreezeDto.java │ │ │ │ ├── FreezeTradeDto.java │ │ │ │ ├── FundDto.java │ │ │ │ ├── LineDto.java │ │ │ │ ├── MenuDto.java │ │ │ │ ├── MerchantDto.java │ │ │ │ ├── StockCompDto.java │ │ │ │ ├── TradeDto.java │ │ │ │ └── UserDto.java │ │ │ │ ├── entity │ │ │ │ ├── Account.java │ │ │ │ ├── AccountLog.java │ │ │ │ ├── BtransLog.java │ │ │ │ ├── CtransLog.java │ │ │ │ ├── EtfInfo.java │ │ │ │ ├── Freeze.java │ │ │ │ ├── FreezeLog.java │ │ │ │ ├── FundInfo.java │ │ │ │ ├── GiveBatchInfo.java │ │ │ │ ├── GiveLog.java │ │ │ │ ├── GiveRefundLog.java │ │ │ │ ├── Menu.java │ │ │ │ ├── Merchant.java │ │ │ │ ├── MerchantLog.java │ │ │ │ ├── PkgInLog.java │ │ │ │ ├── PkgOutLog.java │ │ │ │ ├── StockInfo.java │ │ │ │ └── User.java │ │ │ │ ├── ext │ │ │ │ └── PkgOutLogExt.java │ │ │ │ ├── grant │ │ │ │ ├── BatchGiveReq.java │ │ │ │ ├── GiveRefundReq.java │ │ │ │ ├── GiveReq.java │ │ │ │ ├── GiveResp.java │ │ │ │ ├── GiveUserDto.java │ │ │ │ ├── GrantBusiness.java │ │ │ │ ├── GrantContext.java │ │ │ │ └── hold.md │ │ │ │ ├── mapper │ │ │ │ ├── AccountLogMapper.java │ │ │ │ ├── AccountMapper.java │ │ │ │ ├── BtransLogMapper.java │ │ │ │ ├── CtransLogMapper.java │ │ │ │ ├── EtfInfoMapper.java │ │ │ │ ├── FreezeLogMapper.java │ │ │ │ ├── FreezeMapper.java │ │ │ │ ├── FundInfoMapper.java │ │ │ │ ├── GiveBatchInfoMapper.java │ │ │ │ ├── GiveLogMapper.java │ │ │ │ ├── GiveRefundLogMapper.java │ │ │ │ ├── MenuMapper.java │ │ │ │ ├── MerchantLogMapper.java │ │ │ │ ├── MerchantMapper.java │ │ │ │ ├── PkgInLogMapper.java │ │ │ │ ├── PkgOutLogMapper.java │ │ │ │ ├── StockInfoMapper.java │ │ │ │ └── UserMapper.java │ │ │ │ ├── mock │ │ │ │ └── MockBusiness.java │ │ │ │ ├── order │ │ │ │ ├── OrderInfoDto.java │ │ │ │ └── OrderReq.java │ │ │ │ ├── redpkg │ │ │ │ ├── AbstractRedPkgService.java │ │ │ │ ├── ReceivePkgReq.java │ │ │ │ ├── RedPkgEnum.java │ │ │ │ ├── RedPkgNode.java │ │ │ │ ├── RedPkgService.java │ │ │ │ ├── SendPkgReq.java │ │ │ │ └── impl │ │ │ │ │ ├── GroupRedPkg.java │ │ │ │ │ └── SingleRedPkg.java │ │ │ │ ├── service │ │ │ │ ├── AccountService.java │ │ │ │ ├── GiveBatchInfoService.java │ │ │ │ ├── GiveLogService.java │ │ │ │ ├── GiveRefundLogService.java │ │ │ │ ├── MerchantService.java │ │ │ │ ├── StockService.java │ │ │ │ ├── TransLogService.java │ │ │ │ ├── UserService.java │ │ │ │ └── impl │ │ │ │ │ ├── AccountServiceImpl.java │ │ │ │ │ ├── GiveBatchInfoServiceImpl.java │ │ │ │ │ ├── GiveLogServiceImpl.java │ │ │ │ │ ├── GiveRefundLogServiceImpl.java │ │ │ │ │ ├── MerchantServiceImpl.java │ │ │ │ │ ├── StockServiceImpl.java │ │ │ │ │ ├── TransLogServiceImpl.java │ │ │ │ │ └── UserServiceImpl.java │ │ │ │ ├── stock │ │ │ │ └── RefUtils.java │ │ │ │ ├── task │ │ │ │ ├── FundTask.java │ │ │ │ ├── RedPkgTask.java │ │ │ │ └── StaJuejinList.java │ │ │ │ ├── utils │ │ │ │ ├── AppUtils.java │ │ │ │ ├── Apriori.java │ │ │ │ ├── ExCatchUtils.java │ │ │ │ ├── HandleDocFile.java │ │ │ │ ├── Java8Utils.java │ │ │ │ ├── LocalCacheBuilder.java │ │ │ │ ├── LruCache.java │ │ │ │ ├── MenuUtils.java │ │ │ │ ├── OptionalTest.java │ │ │ │ ├── OrderCalNode.java │ │ │ │ ├── OrderSplitCalUtils.java │ │ │ │ ├── PrintTableUtils.java │ │ │ │ ├── RedPkgUtils.java │ │ │ │ ├── SqlGenUtils.java │ │ │ │ └── TablePrint.java │ │ │ │ └── web │ │ │ │ ├── AccountController.java │ │ │ │ ├── CallBackController.java │ │ │ │ ├── GrantController.java │ │ │ │ ├── HomeController.java │ │ │ │ ├── IndexController.java │ │ │ │ ├── MerchantController.java │ │ │ │ ├── OrderController.java │ │ │ │ ├── PayController.java │ │ │ │ ├── RedPkgController.java │ │ │ │ └── SettleController.java │ │ └── resources │ │ │ ├── application-dev.yml │ │ │ ├── application.yml │ │ │ ├── bootstrap.yml │ │ │ ├── mapper │ │ │ ├── AccountLogMapper.xml │ │ │ ├── AccountMapper.xml │ │ │ ├── BtransLogMapper.xml │ │ │ ├── CtransLogMapper.xml │ │ │ ├── EtfInfoMapper.xml │ │ │ ├── FreezeLogMapper.xml │ │ │ ├── FreezeMapper.xml │ │ │ ├── FundInfoMapper.xml │ │ │ ├── GiveBatchInfoMapper.xml │ │ │ ├── GiveLogMapper.xml │ │ │ ├── GiveRefundLogMapper.xml │ │ │ ├── MenuMapper.xml │ │ │ ├── MerchantLogMapper.xml │ │ │ ├── MerchantMapper.xml │ │ │ ├── PkgInLogMapper.xml │ │ │ ├── PkgOutLogMapper.xml │ │ │ ├── StockInfoMapper.xml │ │ │ └── UserMapper.xml │ │ │ └── tpl │ │ │ ├── controller.java.ftl │ │ │ ├── entity.java.ftl │ │ │ ├── entity_req.java.ftl │ │ │ ├── mapper.java.ftl │ │ │ ├── mapper.xml.ftl │ │ │ ├── service.java.ftl │ │ │ └── serviceImpl.java.ftl │ └── test │ │ └── java │ │ └── com │ │ └── platform │ │ └── productserver │ │ ├── AppEngine.java │ │ ├── MybatisGenerator.java │ │ ├── mock │ │ └── MockBusinessTest.java │ │ └── service │ │ └── impl │ │ └── AccountServiceImplTest.java └── xueqiu.md ├── sandbox-desen ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── platform │ │ └── desen │ │ ├── config │ │ ├── MaskAutoConfig.java │ │ ├── MaskConfig.java │ │ ├── MaskRuleEnum.java │ │ └── SpFactUtils.java │ │ ├── convert │ │ ├── MaskConverter.java │ │ ├── ModuleConverter.java │ │ └── NetAddressConverter.java │ │ ├── handler │ │ ├── AbstractMaskHandler.java │ │ ├── AddressHandler.java │ │ ├── BankHandler.java │ │ ├── EmailHandler.java │ │ ├── IdCardHandler.java │ │ ├── KeyAndCodeHandler.java │ │ ├── MaskHandler.java │ │ ├── NameHandler.java │ │ └── PhoneHandler.java │ │ ├── hold.md │ │ └── utils │ │ ├── KeywordMaskUtils.java │ │ └── RegrexMaskUtils.java │ └── resources │ ├── META-INF │ └── spring.factories │ └── logmask │ ├── log-defaults.xml │ └── log-pattern.xml ├── sandbox-flex ├── README.md ├── mybatis-flex.config ├── pom.xml ├── script │ └── data.sql └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── platform │ │ │ └── flex │ │ │ ├── FlexApplication.java │ │ │ ├── config │ │ │ ├── AppConfig.java │ │ │ └── RocketProducerConfig.java │ │ │ ├── dto │ │ │ ├── OrderDto.java │ │ │ ├── StudentDto.java │ │ │ └── StudentReq.java │ │ │ ├── entity │ │ │ ├── Account.java │ │ │ └── Student.java │ │ │ ├── mapper │ │ │ └── StudentMapper.java │ │ │ ├── mq │ │ │ ├── AppMessageListener.java │ │ │ ├── AppMsgFilterListener.java │ │ │ ├── AppMsgListener.java │ │ │ ├── AppMsgOrderListener.java │ │ │ ├── AppMsgTxListener.java │ │ │ ├── AppMsgTxLocalListener.java │ │ │ └── MsgProvider.java │ │ │ ├── service │ │ │ ├── StudentService.java │ │ │ └── impl │ │ │ │ └── StudentServiceImpl.java │ │ │ ├── utils │ │ │ ├── AppUtils.java │ │ │ ├── DbRowUtils.java │ │ │ ├── IdGenutils.java │ │ │ └── TestStastic.java │ │ │ └── web │ │ │ ├── IndexController.java │ │ │ └── MsgController.java │ └── resources │ │ ├── application-test.yml │ │ ├── application.yml │ │ └── mapper │ │ └── StudentMapper.xml │ └── test │ └── java │ └── com │ └── platform │ └── flex │ ├── FlexApplicationTests.java │ └── MockTest.java ├── sandbox-message ├── README.md ├── pom.xml └── src │ ├── hold.md │ └── main │ ├── java │ └── com │ │ └── platform │ │ └── messsage │ │ ├── BootApplication.java │ │ ├── common │ │ └── AppConstant.java │ │ ├── config │ │ └── RabbitmqConfig.java │ │ ├── dto │ │ └── MsgDto.java │ │ ├── listener │ │ ├── AppConsumer.java │ │ ├── AppRabbitmqListener.java │ │ ├── AppSendMsg.java │ │ └── MqReceiver.java │ │ ├── utils │ │ ├── OrderNoUtils.java │ │ └── QRCodeGenUtils.java │ │ └── web │ │ └── IndexController.java │ └── resources │ └── application.yml ├── sandbox-practice ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── platform │ │ │ └── practice │ │ │ ├── SandboxPracticeApplication.java │ │ │ ├── config │ │ │ └── DynamicDataSourceConfig.java │ │ │ ├── dto │ │ │ └── Result.java │ │ │ ├── utils │ │ │ └── ResponseHelper.java │ │ │ └── web │ │ │ ├── IndexController.java │ │ │ └── RewardController.java │ └── resources │ │ ├── application-test.yml │ │ ├── application.properties │ │ └── application.yml │ └── test │ └── java │ └── com │ └── platform │ └── practice │ └── SandboxPracticeApplicationTests.java ├── sandbox-stock ├── README.md ├── business.sql ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── platform │ │ ├── StockApplication.java │ │ ├── common │ │ ├── ApiException.java │ │ └── HttpStatus.java │ │ ├── config │ │ ├── AppBusConfig.java │ │ ├── AppDataConfig.java │ │ ├── AppExcelListener.java │ │ ├── AppStaticConfig.java │ │ ├── AppWebMvcConfig.java │ │ ├── PassionInterceptor.java │ │ ├── Person.java │ │ ├── ThreadPoolConfig.java │ │ └── WeixinConfig.java │ │ ├── controller │ │ ├── ExcelController.java │ │ ├── GiteeThirdController.java │ │ ├── HomeController.java │ │ ├── IndexController.java │ │ ├── ProtoController.java │ │ ├── ResController.java │ │ ├── RewardController.java │ │ ├── SftpController.java │ │ ├── StockChartController.java │ │ ├── StockInfoController.java │ │ ├── WxPayController.java │ │ └── ZipController.java │ │ ├── dto │ │ ├── AppExcelDto.java │ │ ├── FundDto.java │ │ ├── LineDto.java │ │ ├── PayDto.java │ │ ├── Result.java │ │ ├── SftpDto.java │ │ ├── StockCompDto.java │ │ ├── StockInfoDto.java │ │ ├── StockLineDto.java │ │ ├── Stu.java │ │ ├── UserDto.java │ │ └── student.proto │ │ ├── entity │ │ ├── EtfInfo.java │ │ ├── FundInfo.java │ │ ├── ItemInfo.java │ │ ├── Masseur.java │ │ ├── Reservation.java │ │ ├── ReservationDetail.java │ │ ├── ShopInfo.java │ │ └── StockInfo.java │ │ ├── mapper │ │ ├── EtfInfoMapper.java │ │ ├── FundInfoMapper.java │ │ ├── ReservationDetailMapper.java │ │ ├── ReservationMapper.java │ │ └── StockInfoMapper.java │ │ ├── pojo │ │ ├── base │ │ │ └── BaseResp.java │ │ ├── dto │ │ │ ├── AvaiTimeDto.java │ │ │ ├── BaseInfoDto.java │ │ │ ├── MassBusyDto.java │ │ │ └── TimeNode.java │ │ ├── hold.md │ │ ├── req │ │ │ ├── BaseReq.java │ │ │ ├── ResDetailNode.java │ │ │ ├── ReservationReq.java │ │ │ └── ShopItemReq.java │ │ └── res │ │ │ ├── ItemInfoRes.java │ │ │ ├── MasseurDetailRes.java │ │ │ ├── MasseurInfoRes.java │ │ │ └── ShopInfoRes.java │ │ ├── senstive │ │ ├── PhoneSensitivity.java │ │ ├── SensitiveEnum.java │ │ ├── SensitiveSerializer.java │ │ └── Sensitivity.java │ │ ├── service │ │ ├── ReservationService.java │ │ ├── StockService.java │ │ └── impl │ │ │ ├── ReservationServiceImpl.java │ │ │ └── StockServiceImpl.java │ │ ├── task │ │ └── StockTask.java │ │ └── utils │ │ ├── Entity2SqlUtils.java │ │ ├── EntityUtils.java │ │ ├── ExpressionUtils.java │ │ ├── FakerTest.java │ │ ├── FtpConfig.java │ │ ├── HandleKlassFile.java │ │ ├── HttpUtils.java │ │ ├── HuaUtils.java │ │ ├── IdGenUtils.java │ │ ├── JasyptTestUtils.java │ │ ├── MapsUtils.java │ │ ├── OrderCalNode.java │ │ ├── PrintTableUtils.java │ │ ├── RequestIdHelper.java │ │ ├── RespUtils.java │ │ ├── ResponseHelper.java │ │ ├── SftpUtils.java │ │ ├── SnowStockUtils.java │ │ ├── SshUtils.java │ │ ├── StockCmpUtils.java │ │ ├── StockLineUtils.java │ │ ├── TianFundUtils.java │ │ ├── ZxingUtils.java │ │ └── encdec │ │ ├── AESUtil.java │ │ ├── AppConfig.java │ │ ├── ClientTest.java │ │ ├── CryptUtils.java │ │ ├── ParamEncryptDto.java │ │ ├── RSAUtils.java │ │ ├── ServerTest.java │ │ └── encryption-decryption.md │ └── resources │ ├── application.properties │ ├── application.yml │ ├── data │ ├── data.json │ └── life-expectancy-table.json │ ├── logback-spring-bak.xml │ ├── mapper │ ├── EtfInfoMapper.xml │ ├── FundInfoMapper.xml │ ├── ReservationDetailMapper.xml │ ├── ReservationMapper.xml │ └── StockInfoMapper.xml │ ├── static │ ├── favicon.ico │ ├── hold.md │ └── js │ │ ├── bootstrap.min.css │ │ ├── echarts.min.js │ │ ├── jquery.min.js │ │ └── vue.min.js │ └── templates │ ├── index.ftl │ ├── index.html │ ├── test01.ftl │ ├── test01_bak.ftl │ ├── test02.ftl │ └── test02_bak.ftl ├── script ├── business.sql ├── db_data.sql ├── ocean_base_db.sql ├── route_data.json └── sys.sql └── vue-learn ├── vue_001.html └── vue_learn.md /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .idea 3 | *.iws 4 | *.iml 5 | *.ipr 6 | target 7 | application-prod.yml 8 | application-dev.yml 9 | barcode.png 10 | qrcode.png 11 | # product-server/src/test/java/com/platform/productserver/MybatisGenerator.java 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 thedestiny 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/api/OrderApi.java: -------------------------------------------------------------------------------- 1 | package com.platform.authcommon.api; 2 | 3 | 4 | import com.platform.authcommon.dto.OrderDto; 5 | import org.springframework.cloud.openfeign.FeignClient; 6 | import org.springframework.http.MediaType; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | 10 | @FeignClient(value = "order-server") 11 | public interface OrderApi { 12 | 13 | @PostMapping(value = "/order/info", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 14 | OrderDto queryOrderInfo(String order); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/base/BaseReq.java: -------------------------------------------------------------------------------- 1 | package com.platform.authcommon.base; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import io.swagger.annotations.ApiOperation; 5 | import lombok.Data; 6 | import org.hibernate.validator.constraints.Length; 7 | 8 | import javax.validation.constraints.NotBlank; 9 | import java.io.Serializable; 10 | 11 | /** 12 | * @Description 基本请求 13 | * @Date 2023-09-07 4:43 PM 14 | */ 15 | @Data 16 | @ApiOperation(value = "基本请求") 17 | public class BaseReq implements Serializable { 18 | 19 | private static final long serialVersionUID = 1026974910115244722L; 20 | 21 | @ApiModelProperty("请求时间戳") 22 | private Long timestamp; 23 | 24 | @ApiModelProperty("请求号") 25 | @NotBlank(message = "请求号不能为空") 26 | @Length(max = 50, message = "来源长度不能超过50个字符") 27 | private String requestNo; 28 | 29 | @ApiModelProperty("来源,默认为0") 30 | @NotBlank(message = "来源不能为空") 31 | @Length(max = 50, message = "请求号长度不能超过32个字符") 32 | private String source; 33 | 34 | @ApiModelProperty("备注") 35 | @Length(max = 300, message = "备注信息不能超过300个字符") 36 | private String remark; 37 | 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/common/Constant.java: -------------------------------------------------------------------------------- 1 | package com.platform.authcommon.common; 2 | 3 | import cn.hutool.core.date.DateUtil; 4 | 5 | /** 6 | * @Description 常量 7 | * @Date 2023-08-15 10:52 AM 8 | */ 9 | public class Constant { 10 | 11 | 12 | public static final String EQUALS_LINE = "="; 13 | public static final String REDIS_SPLIT_LINE = EQUALS_LINE; 14 | public static final String PLUS = "+"; 15 | public static final String REDIS_KEY_CONNECTION_LINE = PLUS; 16 | public static final String SPLIT_PLUS = "\\+"; 17 | public static final String REDIS_SPLIT_KEY_CONNECTION_LINE = SPLIT_PLUS; 18 | 19 | // 红包业务前缀 20 | public final static String RED_PKG_PREFIX = "RED:"; 21 | // 分布式锁的 redis key 22 | public final static String DIS_KEY = "DIS_KEY:"; 23 | 24 | public final static Long DEFAULT_SEQ = 0L; 25 | // 单次查询数据量 26 | public final static Integer BATCH_SIZE = 200; 27 | 28 | 29 | public static void main(String[] args) { 30 | 31 | String time = DateUtil.format(DateUtil.date(), "yyMMdd"); 32 | System.out.println(time); 33 | String format = String.format("%05d", 1); 34 | System.out.println(format); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/common/ErrorCode.java: -------------------------------------------------------------------------------- 1 | package com.platform.authcommon.common; 2 | 3 | /** 4 | * 封装API的错误码 5 | */ 6 | public interface ErrorCode { 7 | 8 | Integer getCode(); 9 | 10 | String getMessage(); 11 | } 12 | -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/common/ResultCode.java: -------------------------------------------------------------------------------- 1 | package com.platform.authcommon.common; 2 | 3 | /** 4 | * 枚举状态码 5 | */ 6 | public enum ResultCode implements ErrorCode { 7 | 8 | SUCCESS(200, "操作成功"), 9 | FAILED(500, "操作失败"), 10 | VALIDATE_FAILED(404, "参数检验失败"), 11 | UNAUTHORIZED(401, "暂未登录或token已经过期"), 12 | FORBIDDEN(403, "没有相关权限"), 13 | NOT_EXIST(1003, "账户不存在"), 14 | SAVE_FAILURE(1004, "数据保存失败"), 15 | // SAVE_FAILURE(1005, "数据不存在"), 16 | 17 | ; 18 | 19 | 20 | private Integer code; 21 | private String message; 22 | 23 | ResultCode(Integer code, String message) { 24 | this.code = code; 25 | this.message = message; 26 | } 27 | 28 | public Integer getCode() { 29 | return code; 30 | } 31 | 32 | public String getMessage() { 33 | return message; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/common/StatusEnum.java: -------------------------------------------------------------------------------- 1 | package com.platform.authcommon.common; 2 | 3 | /** 4 | * @Description 账户状态 5 | * @Date 2023-09-08 4:19 PM 6 | */ 7 | public enum StatusEnum { 8 | 9 | 10 | DISABLE(0, "disable", "禁用"), 11 | ENABLE(1, "enable", "启用"), 12 | LOCKED(2, "locked", "锁定"), 13 | ; 14 | 15 | 16 | public Integer code; 17 | public String msg; 18 | public String detail; 19 | 20 | StatusEnum(Integer status, String msg, String detail) { 21 | this.code = status; 22 | this.msg = msg; 23 | this.detail = detail; 24 | } 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/common/TokenConstant.java: -------------------------------------------------------------------------------- 1 | package com.platform.authcommon.common; 2 | 3 | /** 4 | * @Description 5 | * @Date 2023-09-11 11:14 AM 6 | */ 7 | public class TokenConstant { 8 | 9 | 10 | public static final String PRINCIPAL_NAME = "principal"; 11 | public static final String USER_ID = "userid"; 12 | public static final String JTI = "jti"; 13 | public static final String EXPR = "expire"; 14 | 15 | 16 | public static final String AUTHORITIES_NAME = "authorities"; 17 | 18 | public static final String LOGIN_ATTRIBUTE = "attribute"; 19 | } 20 | -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/common/TransTypeEnum.java: -------------------------------------------------------------------------------- 1 | package com.platform.authcommon.common; 2 | 3 | import com.platform.authcommon.exception.AppException; 4 | import lombok.Getter; 5 | 6 | @Getter 7 | public enum TransTypeEnum { 8 | 9 | TRANS_IN(101, "转入", "+"), 10 | TRANS_OUT(102, "转出", "-"), 11 | TRADE_IN(103, "入账", "+"), 12 | TRADE_OUT(104, "出账", "-"), 13 | 14 | FREEZE(201, "冻结", "|"), 15 | UNFREEZE(202, "解冻", "|"), 16 | FREEZE_OUT(203, "解冻并出账", "-"), 17 | FREEZE_IN(204, "入账并冻结", "+"), 18 | 19 | 20 | ; 21 | 22 | 23 | TransTypeEnum(Integer code, String name, String opt) { 24 | this.code = code; 25 | this.name = name; 26 | this.opt = opt; 27 | } 28 | 29 | private Integer code; 30 | 31 | private String name; 32 | 33 | private String opt; 34 | 35 | /** 36 | * 交易交易类型 37 | */ 38 | public static TransTypeEnum checkTransType(Integer transType){ 39 | 40 | for (TransTypeEnum node : TransTypeEnum.values()){ 41 | if(node.code == transType){ 42 | return node; 43 | } 44 | } 45 | throw new AppException(ResultCode.NOT_EXIST, "交易类型不存在"); 46 | } 47 | 48 | 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/common/aop/LockType.java: -------------------------------------------------------------------------------- 1 | package com.platform.authcommon.common.aop; 2 | 3 | /** 4 | * @Description 分布式锁类型 5 | */ 6 | public enum LockType { 7 | 8 | /** 可重入锁*/ 9 | REENTRANT_LOCK, 10 | 11 | /** 公平锁*/ 12 | FAIR_LOCK, 13 | 14 | /** 读锁*/ 15 | READ_LOCK, 16 | 17 | /** 写锁*/ 18 | WRITE_LOCK 19 | } 20 | -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/common/aop/annotation/DistributedLock.java: -------------------------------------------------------------------------------- 1 | package com.platform.authcommon.common.aop.annotation; 2 | 3 | 4 | import com.platform.authcommon.common.aop.LockType; 5 | 6 | import java.lang.annotation.*; 7 | import java.util.concurrent.TimeUnit; 8 | 9 | /** 10 | * Redisson分布式锁注解 11 | */ 12 | @Documented 13 | @Inherited 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Target({ElementType.TYPE, ElementType.METHOD}) 16 | public @interface DistributedLock { 17 | 18 | /** 19 | * 锁的资源,key。支持spring El表达式 20 | */ 21 | String prefix() default "dist-lock-redisson"; 22 | 23 | /** 24 | * 分布式锁名称: prefix+key 25 | */ 26 | String key() default ""; 27 | 28 | /** 29 | * 获取锁等待时间,默认3秒 30 | */ 31 | long waitTime() default 3L; 32 | 33 | /** 34 | * 锁超时时间,默认60秒 35 | */ 36 | int expireTime() default 60; 37 | 38 | /** 39 | * 锁超时时间单位,默认为秒 40 | */ 41 | TimeUnit unit() default TimeUnit.SECONDS; 42 | 43 | /** 44 | * 锁类型 默认为可重入锁 45 | */ 46 | LockType lockType() default LockType.REENTRANT_LOCK; 47 | 48 | /** 49 | * 缓存值 50 | */ 51 | String cacheValue() default ""; 52 | 53 | } 54 | 55 | 56 | -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/common/aop/annotation/RestMapping.java: -------------------------------------------------------------------------------- 1 | package com.platform.authcommon.common.aop.annotation; 2 | 3 | import org.springframework.web.bind.annotation.Mapping; 4 | import org.springframework.web.bind.annotation.RequestMethod; 5 | 6 | import java.lang.annotation.*; 7 | 8 | /** 9 | * 自定义注解 10 | * @Date 2023-09-25 2:24 PM 11 | */ 12 | 13 | @Target({ElementType.METHOD, ElementType.TYPE}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Documented 16 | @Mapping 17 | public @interface RestMapping { 18 | 19 | 20 | String value() default ""; 21 | 22 | RequestMethod method() default RequestMethod.GET; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/dto/AuthConstant.java: -------------------------------------------------------------------------------- 1 | package com.platform.authcommon.dto; 2 | 3 | /** 4 | * 5 | */ 6 | public class AuthConstant { 7 | 8 | public static final String AUTHORITY_PREFIX = "ROLE_"; 9 | 10 | public static final String AUTHORITY_CLAIM_NAME = "authorities"; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/dto/LoginDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.authcommon.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 登录对象 9 | * @Description 10 | * @Date 2023-09-11 11:17 AM 11 | */ 12 | 13 | @Data 14 | public class LoginDto { 15 | 16 | 17 | private String userId; 18 | private String username; 19 | private List authorities; 20 | private String jti; 21 | private Long expireIn; 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/dto/MessageConstant.java: -------------------------------------------------------------------------------- 1 | package com.platform.authcommon.dto; 2 | 3 | /** 4 | * 消息常量 5 | */ 6 | public class MessageConstant { 7 | 8 | public static final String LOGIN_SUCCESS = "登录成功!"; 9 | 10 | public static final String USERNAME_PASSWORD_ERROR = "用户名或密码错误!"; 11 | 12 | public static final String CREDENTIALS_EXPIRED = "该账户的登录凭证已过期,请重新登录!"; 13 | 14 | public static final String ACCOUNT_DISABLED = "该账户已被禁用,请联系管理员!"; 15 | 16 | public static final String ACCOUNT_LOCKED = "该账号已被锁定,请联系管理员!"; 17 | 18 | public static final String ACCOUNT_EXPIRED = "该账号已过期,请联系管理员!"; 19 | 20 | public static final String PERMISSION_DENIED = "没有访问权限,请联系管理员!"; 21 | 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/dto/OrderDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.authcommon.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.math.BigDecimal; 8 | import java.util.Date; 9 | 10 | @Data 11 | public class OrderDto implements Serializable { 12 | 13 | 14 | private static final long serialVersionUID = -8592616479203242217L; 15 | 16 | private String userId; 17 | 18 | private String orderNo; 19 | 20 | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") 21 | private Date createTime; 22 | 23 | private BigDecimal amount; 24 | 25 | private String name; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/dto/RedisConstant.java: -------------------------------------------------------------------------------- 1 | package com.platform.authcommon.dto; 2 | 3 | /** 4 | * Redis常量 5 | */ 6 | public class RedisConstant { 7 | 8 | public static final String RESOURCE_ROLES_MAP = "AUTH:RESOURCE_ROLES_MAP"; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/dto/UserDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.authcommon.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | import java.io.Serializable; 8 | import java.util.List; 9 | 10 | /** 11 | * Created by macro on 2020/6/19. 12 | */ 13 | @Data 14 | @EqualsAndHashCode(callSuper = false) 15 | @AllArgsConstructor 16 | public class UserDto implements Serializable { 17 | 18 | private Long id; 19 | private String username; 20 | private String password; 21 | private Integer status; 22 | private String jti; 23 | private String client_id; 24 | // 用户角色 25 | private List roles; 26 | private List aud; 27 | 28 | private List scope; 29 | // 用户权限 30 | private List authorities; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/exception/WebExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.platform.authcommon.exception; 2 | 3 | import com.google.common.base.Throwables; 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.springframework.stereotype.Component; 6 | import org.springframework.web.bind.annotation.ControllerAdvice; 7 | import org.springframework.web.bind.annotation.ExceptionHandler; 8 | 9 | /** 10 | * 页面异常处理器 11 | */ 12 | @Slf4j 13 | @Component 14 | @ControllerAdvice 15 | public class WebExceptionHandler { 16 | 17 | 18 | /** 19 | * 页面异常处理 20 | */ 21 | @ExceptionHandler(AppException.class) 22 | public String handleAppException(AppException e) { 23 | String th = Throwables.getStackTraceAsString(e); 24 | log.info("error info {}", th); 25 | return "error"; 26 | } 27 | 28 | @ExceptionHandler(Exception.class) 29 | public String handleException(Exception e) { 30 | String th = Throwables.getStackTraceAsString(e); 31 | log.info("error info {}", th); 32 | return "error"; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/filter/hold.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedestiny/springboot-auth/72f7f52f02ddbd42bdba6678d784651084484894/auth-common/src/main/java/com/platform/authcommon/filter/hold.md -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/model/Customer.java: -------------------------------------------------------------------------------- 1 | package com.platform.authcommon.model; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @AllArgsConstructor 9 | @NoArgsConstructor 10 | public class Customer implements Recommend { 11 | 12 | // 数据id 13 | private Long id; 14 | // 用户id 15 | private Long customerId; 16 | // 商品id 17 | private Long commodityId; 18 | // 分值 19 | private Float value; 20 | 21 | // private Date createTime; 22 | 23 | @Override 24 | public long getUserId() { 25 | return this.customerId; 26 | } 27 | 28 | @Override 29 | public long getItemId() { 30 | return this.commodityId; 31 | } 32 | @Override 33 | public float getValue() { 34 | return this.value; 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/model/FilterRescorer.java: -------------------------------------------------------------------------------- 1 | package com.platform.authcommon.model; 2 | 3 | import org.apache.mahout.cf.taste.recommender.IDRescorer; 4 | 5 | import java.util.Set; 6 | 7 | public class FilterRescorer implements IDRescorer { 8 | 9 | final private Set userIds; 10 | 11 | public FilterRescorer(Set userIds) { 12 | this.userIds = userIds; 13 | } 14 | 15 | @Override 16 | public double rescore(long id, double originalScore) { 17 | return isFiltered(id) ? Double.NaN : originalScore; 18 | } 19 | 20 | @Override 21 | public boolean isFiltered(long id) { 22 | return userIds.contains(id); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/model/Recommend.java: -------------------------------------------------------------------------------- 1 | package com.platform.authcommon.model; 2 | 3 | public interface Recommend { 4 | 5 | long getUserId(); 6 | long getItemId(); 7 | float getValue(); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/model/hold.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedestiny/springboot-auth/72f7f52f02ddbd42bdba6678d784651084484894/auth-common/src/main/java/com/platform/authcommon/model/hold.md -------------------------------------------------------------------------------- /auth-common/src/main/java/com/platform/authcommon/utils/IdGenUtils.java: -------------------------------------------------------------------------------- 1 | package com.platform.authcommon.utils; 2 | 3 | 4 | import cn.hutool.core.lang.Snowflake; 5 | import lombok.extern.slf4j.Slf4j; 6 | 7 | /** 8 | * id 生成器 9 | */ 10 | @Slf4j 11 | public class IdGenUtils { 12 | 13 | 14 | private static final Snowflake flake; 15 | 16 | static { 17 | flake = new Snowflake(); 18 | } 19 | 20 | 21 | public static String orderNo(){ 22 | return "T" + flake.nextIdStr(); 23 | } 24 | 25 | 26 | public static String id() { 27 | return flake.nextIdStr(); 28 | } 29 | 30 | 31 | public static Long pid() { 32 | return flake.nextId(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /auth-gateway/src/main/java/com/platform/authgateway/AuthGatewayApplication.java: -------------------------------------------------------------------------------- 1 | package com.platform.authgateway; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 7 | import org.springframework.cloud.context.config.annotation.RefreshScope; 8 | 9 | @Slf4j 10 | @EnableDiscoveryClient 11 | @SpringBootApplication 12 | public class AuthGatewayApplication { 13 | 14 | public static void main(String[] args) { 15 | 16 | log.info(" start app gateway ! "); 17 | SpringApplication.run(AuthGatewayApplication.class, args); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /auth-gateway/src/main/java/com/platform/authgateway/config/GateWayConfig.java: -------------------------------------------------------------------------------- 1 | package com.platform.authgateway.config; 2 | 3 | import org.springframework.cloud.gateway.route.RouteLocator; 4 | import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | @Configuration 9 | public class GateWayConfig { 10 | 11 | 12 | // gateway 网关配置 13 | @Bean 14 | public RouteLocator customRouteLocator(RouteLocatorBuilder routeLocatorBuilder) { 15 | RouteLocatorBuilder.Builder routes = routeLocatorBuilder.routes(); 16 | routes.route("settle-server", 17 | r -> r.path("/settle/**") 18 | .uri("lb://product-server") 19 | ).build(); 20 | 21 | return routes.build(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /auth-gateway/src/main/java/com/platform/authgateway/config/GatewayRouteConfig.java: -------------------------------------------------------------------------------- 1 | package com.platform.authgateway.config; 2 | 3 | 4 | import lombok.Data; 5 | import org.springframework.boot.context.properties.ConfigurationProperties; 6 | import org.springframework.stereotype.Component; 7 | 8 | // 配置 网关的配置信息,动态网关配置信息 9 | @ConfigurationProperties(prefix = "gateway.routes.config") 10 | @Component 11 | @Data 12 | public class GatewayRouteConfig { 13 | 14 | private String dataId; 15 | 16 | private String group; 17 | 18 | private String namespace; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /auth-gateway/src/main/java/com/platform/authgateway/config/IgnoreUrlsConfig.java: -------------------------------------------------------------------------------- 1 | package com.platform.authgateway.config; 2 | 3 | 4 | import lombok.Data; 5 | import org.springframework.boot.context.properties.ConfigurationProperties; 6 | import org.springframework.stereotype.Component; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 网关白名单配置 12 | */ 13 | @Data 14 | @Component 15 | @ConfigurationProperties(prefix="secure.ignore") 16 | public class IgnoreUrlsConfig { 17 | 18 | private List urls; 19 | } 20 | -------------------------------------------------------------------------------- /auth-gateway/src/main/java/com/platform/authgateway/config/RouteService.java: -------------------------------------------------------------------------------- 1 | package com.platform.authgateway.config; 2 | 3 | import org.springframework.cloud.gateway.route.RouteDefinition; 4 | 5 | public interface RouteService { 6 | 7 | 8 | /** 9 | * 更新路由配置 10 | * 11 | * @param routeDefinition 12 | */ 13 | void update(RouteDefinition routeDefinition); 14 | 15 | /** 16 | * 添加路由配置 17 | * 18 | * @param routeDefinition 19 | */ 20 | void add(RouteDefinition routeDefinition); 21 | 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /auth-mpg/src/main/java/com/platform/authmpg/AuthMpgApplication.java: -------------------------------------------------------------------------------- 1 | package com.platform.authmpg; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | 8 | @Slf4j 9 | @SpringBootApplication 10 | public class AuthMpgApplication { 11 | 12 | public static void main(String[] args) { 13 | log.info("start app !"); 14 | SpringApplication.run(AuthMpgApplication.class, args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /auth-mpg/src/main/java/com/platform/authmpg/dto/UserDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.authmpg.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @Description 9 | * @Author liangkaiyang 10 | * @Date 2025-06-06 3:45 PM 11 | */ 12 | 13 | @Data 14 | public class UserDto implements Serializable { 15 | 16 | 17 | private Long id; 18 | 19 | private String name; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /auth-mpg/src/main/java/com/platform/authmpg/web/IndexController.java: -------------------------------------------------------------------------------- 1 | package com.platform.authmpg.web; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | /** 8 | * @Description 9 | * @Author liangkaiyang 10 | * @Date 2025-06-06 3:42 PM 11 | */ 12 | 13 | 14 | @Slf4j 15 | @RestController 16 | public class IndexController { 17 | 18 | 19 | @GetMapping(value = "index") 20 | public String index(){ 21 | return "success"; 22 | } 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /auth-mpg/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:mysql://localhost:3306/my_database 4 | username: root 5 | password: 123456 6 | server: 7 | port: 9096 8 | -------------------------------------------------------------------------------- /auth-mpg/src/main/resources/hold.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedestiny/springboot-auth/72f7f52f02ddbd42bdba6678d784651084484894/auth-mpg/src/main/resources/hold.md -------------------------------------------------------------------------------- /auth-mpg/src/test/java/com/platform/authmpg/AuthMpgApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.platform.authmpg; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class AuthMpgApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /auth-server/src/main/java/com/platform/authserver/AuthServerApplication.java: -------------------------------------------------------------------------------- 1 | package com.platform.authserver; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 7 | import org.springframework.cloud.context.config.annotation.RefreshScope; 8 | import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer; 9 | 10 | @Slf4j 11 | @RefreshScope 12 | @EnableAuthorizationServer 13 | @EnableDiscoveryClient 14 | @SpringBootApplication 15 | public class AuthServerApplication { 16 | 17 | public static void main(String[] args) { 18 | log.info("start auth server !"); 19 | SpringApplication.run(AuthServerApplication.class, args); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /auth-server/src/main/java/com/platform/authserver/constant/MessageConstant.java: -------------------------------------------------------------------------------- 1 | package com.platform.authserver.constant; 2 | 3 | /** 4 | * 消息常量 5 | */ 6 | public class MessageConstant { 7 | 8 | public static final String LOGIN_SUCCESS = "登录成功!"; 9 | 10 | public static final String USERNAME_PASSWORD_ERROR = "用户名或密码错误!"; 11 | 12 | public static final String CREDENTIALS_EXPIRED = "该账户的登录凭证已过期,请重新登录!"; 13 | 14 | public static final String ACCOUNT_DISABLED = "该账户已被禁用,请联系管理员!"; 15 | 16 | public static final String ACCOUNT_LOCKED = "该账号已被锁定,请联系管理员!"; 17 | 18 | public static final String ACCOUNT_EXPIRED = "该账号已过期,请联系管理员!"; 19 | 20 | public static final String PERMISSION_DENIED = "没有访问权限,请联系管理员!"; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /auth-server/src/main/java/com/platform/authserver/constant/RedisConstant.java: -------------------------------------------------------------------------------- 1 | package com.platform.authserver.constant; 2 | 3 | /** 4 | * Redis常量 5 | */ 6 | public class RedisConstant { 7 | 8 | public static final String RESOURCE_ROLES_MAP = "AUTH:RESOURCE_ROLES_MAP"; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /auth-server/src/main/java/com/platform/authserver/domain/Oauth2TokenDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.authserver.domain; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | /** 8 | * Oauth2获取Token返回信息封装 9 | * Created by macro on 2020/7/17. 10 | */ 11 | @Data 12 | @EqualsAndHashCode(callSuper = false) 13 | @Builder 14 | public class Oauth2TokenDto { 15 | /** 16 | * 访问令牌 17 | */ 18 | private String token; 19 | /** 20 | * 刷新令牌 21 | */ 22 | private String refreshToken; 23 | /** 24 | * 访问令牌头前缀 25 | */ 26 | private String tokenHead; 27 | /** 28 | * 有效时间(秒) 29 | */ 30 | private int expiresIn; 31 | } 32 | -------------------------------------------------------------------------------- /auth-server/src/main/java/com/platform/authserver/domain/UserDTO.java: -------------------------------------------------------------------------------- 1 | package com.platform.authserver.domain; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | import java.io.Serializable; 8 | import java.util.List; 9 | 10 | /** 11 | * Created by macro on 2020/6/19. 12 | */ 13 | @Data 14 | @EqualsAndHashCode(callSuper = false) 15 | @AllArgsConstructor 16 | public class UserDTO implements Serializable { 17 | 18 | private Long id; 19 | private String username; 20 | private String password; 21 | private Integer status; 22 | private List roles; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /auth-server/src/main/java/com/platform/authserver/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.platform.authserver.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | 10 | @Data 11 | @TableName(value = "tb_user") 12 | public class User implements Serializable { 13 | 14 | @TableId(value = "id", type = IdType.ASSIGN_ID) 15 | private Long id; 16 | /** 17 | * 用户名 18 | */ 19 | private String username; 20 | /** 21 | * 用户密码 22 | */ 23 | private String password; 24 | /** 25 | * 用户状态 26 | */ 27 | private Integer enabled; 28 | 29 | 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /auth-server/src/main/java/com/platform/authserver/exception/Oauth2ExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.platform.authserver.exception; 2 | 3 | import com.platform.authcommon.common.Result; 4 | import org.springframework.security.oauth2.common.exceptions.OAuth2Exception; 5 | import org.springframework.web.bind.annotation.ExceptionHandler; 6 | import org.springframework.web.bind.annotation.RestControllerAdvice; 7 | 8 | /** 9 | * 全局处理Oauth2抛出的异常 10 | */ 11 | @RestControllerAdvice 12 | public class Oauth2ExceptionHandler { 13 | 14 | @ExceptionHandler(value = OAuth2Exception.class) 15 | public Result handleOauth2(OAuth2Exception e) { 16 | return Result.failed(e.getMessage()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /auth-server/src/main/java/com/platform/authserver/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.authserver.mapper; 2 | 3 | public interface UserMapper { 4 | 5 | 6 | 7 | } 8 | -------------------------------------------------------------------------------- /auth-server/src/main/java/com/platform/authserver/service/ResourceService.java: -------------------------------------------------------------------------------- 1 | package com.platform.authserver.service; 2 | 3 | import cn.hutool.core.collection.CollUtil; 4 | import com.platform.authserver.constant.RedisConstant; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.data.redis.core.RedisTemplate; 7 | import org.springframework.stereotype.Service; 8 | 9 | import javax.annotation.PostConstruct; 10 | import java.util.List; 11 | import java.util.Map; 12 | import java.util.TreeMap; 13 | 14 | @Service 15 | public class ResourceService { 16 | 17 | private Map> resourceRolesMap; 18 | @Autowired 19 | private RedisTemplate redisTemplate; 20 | 21 | @PostConstruct 22 | public void initData() { 23 | resourceRolesMap = new TreeMap<>(); 24 | resourceRolesMap.put("/api/hello", CollUtil.toList("ADMIN")); 25 | resourceRolesMap.put("/api/user/currentUser", CollUtil.toList("ADMIN", "TEST")); 26 | redisTemplate.opsForHash().putAll(RedisConstant.RESOURCE_ROLES_MAP, resourceRolesMap); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /auth-server/src/main/java/com/platform/authserver/web/GrantController.java: -------------------------------------------------------------------------------- 1 | package com.platform.authserver.web; 2 | 3 | import org.springframework.security.oauth2.provider.AuthorizationRequest; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.SessionAttributes; 8 | import org.springframework.web.servlet.ModelAndView; 9 | 10 | import javax.servlet.http.HttpServletRequest; 11 | import java.util.Map; 12 | 13 | /** 14 | * @author kdyzm 15 | */ 16 | @Controller 17 | @SessionAttributes("authorizationRequest") 18 | public class GrantController { 19 | 20 | /** 21 | * @throws Exception 22 | */ 23 | @RequestMapping("/custom/confirm_access") 24 | public String getAccessConfirmation(Map params, HttpServletRequest request, Model model) throws Exception { 25 | AuthorizationRequest author = 26 | (AuthorizationRequest) params.get("authorizationRequest"); 27 | 28 | model.addAttribute("clientId", author.getClientId()); 29 | model.addAttribute("scopes", author.getScope()); 30 | return "grant"; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /auth-server/src/main/java/com/platform/authserver/web/IndexController.java: -------------------------------------------------------------------------------- 1 | package com.platform.authserver.web; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | /** 9 | * @Description 10 | * @Author kaiyang 11 | * @Date 2022-11-16 5:26 PM 12 | */ 13 | 14 | @Slf4j 15 | @RequestMapping 16 | @Controller 17 | public class IndexController { 18 | 19 | @GetMapping(value = "login") 20 | public String login(){ 21 | log.info("info login! "); 22 | return "login"; 23 | } 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /auth-server/src/main/java/com/platform/authserver/web/KeyPairController.java: -------------------------------------------------------------------------------- 1 | package com.platform.authserver.web; 2 | 3 | import com.nimbusds.jose.jwk.JWKSet; 4 | import com.nimbusds.jose.jwk.RSAKey; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | import java.security.KeyPair; 10 | import java.security.interfaces.RSAPublicKey; 11 | import java.util.Map; 12 | 13 | /** 14 | * 获取RSA公钥接口 15 | */ 16 | @RestController 17 | public class KeyPairController { 18 | 19 | @Autowired 20 | private KeyPair keyPair; 21 | 22 | @GetMapping("/rsa/publicKey") 23 | public Map getKey() { 24 | RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic(); 25 | RSAKey key = new RSAKey.Builder(publicKey).build(); 26 | return new JWKSet(key).toJSONObject(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /auth-server/src/main/resources/jwt.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedestiny/springboot-auth/72f7f52f02ddbd42bdba6678d784651084484894/auth-server/src/main/resources/jwt.jks -------------------------------------------------------------------------------- /auth-server/src/main/resources/static/hold.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedestiny/springboot-auth/72f7f52f02ddbd42bdba6678d784651084484894/auth-server/src/main/resources/static/hold.md -------------------------------------------------------------------------------- /auth-server/src/main/resources/templates/login.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 登录页面 9 | 10 | 11 | 12 | 13 |
14 |

Login

15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 |
27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /data-cleaning/src/main/java/com/platform/migrate/DataCleaningApplication.java: -------------------------------------------------------------------------------- 1 | package com.platform.migrate; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | /** 8 | * marathon 9 | */ 10 | 11 | @Slf4j 12 | @SpringBootApplication 13 | public class DataCleaningApplication { 14 | 15 | public static void main(String[] args) { 16 | log.info("start server "); 17 | SpringApplication.run(DataCleaningApplication.class, args); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /data-cleaning/src/main/java/com/platform/migrate/dto/UserDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.migrate.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @Description 9 | * @Author kaiyang 10 | * @Date 2024-03-27 5:25 PM 11 | */ 12 | 13 | @Data 14 | public class UserDto implements Serializable { 15 | 16 | 17 | private String username; 18 | 19 | private String password; 20 | 21 | 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /data-cleaning/src/main/java/com/platform/migrate/web/IndexController.java: -------------------------------------------------------------------------------- 1 | package com.platform.migrate.web; 2 | 3 | 4 | import com.alibaba.fastjson.JSONObject; 5 | import com.platform.migrate.dto.UserDto; 6 | import lombok.extern.slf4j.Slf4j; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | @Slf4j 13 | @RequestMapping(value = "api") 14 | @RestController 15 | public class IndexController { 16 | 17 | 18 | @PostMapping(value = "index") 19 | public String index(@RequestBody UserDto dto) { 20 | log.info("information {} ", JSONObject.toJSONString(dto)); 21 | return dto.toString(); 22 | } 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /data-cleaning/src/main/java/com/platform/migrate/web/ShortController.java: -------------------------------------------------------------------------------- 1 | package com.platform.migrate.web; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.http.HttpStatus; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PathVariable; 8 | import org.springframework.web.servlet.view.RedirectView; 9 | 10 | /** 11 | * @Description 12 | * @Author kaiyang 13 | * @Date 2024-03-28 5:03 PM 14 | */ 15 | 16 | @Slf4j 17 | @Controller 18 | public class ShortController { 19 | 20 | 21 | /** 22 | * 短链跳转 23 | * 302,代表临时重定向,同样的请求再次访问不会被浏览器缓存, 24 | * 301, 代表永久重定向,同样的请求再次访问会被浏览器缓存 25 | * @param shortCode 26 | * @return 27 | */ 28 | @GetMapping("/{shortCode}") 29 | public RedirectView redirect(@PathVariable String shortCode) { 30 | String destUrl = "https://baidu.com"; 31 | // todo some business 统计打开次数 32 | RedirectView view = new RedirectView(destUrl + "/" + shortCode); 33 | view.setStatusCode(HttpStatus.MOVED_PERMANENTLY); // 301 34 | view.setStatusCode(HttpStatus.MOVED_TEMPORARILY); // 302 35 | return view; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /data-cleaning/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 9099 3 | spring: 4 | profiles: 5 | active: dev 6 | 7 | 8 | 9 | datasource: 10 | hikari: 11 | driver-class-name: com.mysql.cj.jdbc.Driver 12 | auto-commit: false 13 | idle-timeout: 20000 14 | maximum-pool-size: 2000 15 | pool-name: data-cleaning-pool 16 | type: com.zaxxer.hikari.HikariDataSource 17 | 18 | 19 | 20 | 21 | 22 | 23 | logging: 24 | level: 25 | com.platform.migrate: info 26 | org.apache.flink.runtime.checkpoint: warn 27 | org.apache.flink.runtime.source.coordinator.SourceCoordinator: warn 28 | com.ververica.cdc.connectors.mysql.source.reader.MySqlSourceReader: warn 29 | -------------------------------------------------------------------------------- /data.txt: -------------------------------------------------------------------------------- 1 | #00008b 2 | #f00 3 | #ffde00 4 | #002a8f 5 | #003580 6 | #ed2939 7 | #000 8 | #003897 9 | #f93 10 | #bc002d 11 | #024fa2 12 | #000 13 | #00247d 14 | #ef2b2d 15 | #dc143c 16 | #d52b1e 17 | #e30a17 18 | #00247d 19 | #b22234 20 | -------------------------------------------------------------------------------- /data/20221127182040.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedestiny/springboot-auth/72f7f52f02ddbd42bdba6678d784651084484894/data/20221127182040.png -------------------------------------------------------------------------------- /data/20221127182114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedestiny/springboot-auth/72f7f52f02ddbd42bdba6678d784651084484894/data/20221127182114.png -------------------------------------------------------------------------------- /data/20221127182150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedestiny/springboot-auth/72f7f52f02ddbd42bdba6678d784651084484894/data/20221127182150.png -------------------------------------------------------------------------------- /data/20221127182256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedestiny/springboot-auth/72f7f52f02ddbd42bdba6678d784651084484894/data/20221127182256.png -------------------------------------------------------------------------------- /data/20221127182324.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedestiny/springboot-auth/72f7f52f02ddbd42bdba6678d784651084484894/data/20221127182324.png -------------------------------------------------------------------------------- /data/20221127182520.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedestiny/springboot-auth/72f7f52f02ddbd42bdba6678d784651084484894/data/20221127182520.png -------------------------------------------------------------------------------- /data/20221127182552.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedestiny/springboot-auth/72f7f52f02ddbd42bdba6678d784651084484894/data/20221127182552.png -------------------------------------------------------------------------------- /data/doc.md: -------------------------------------------------------------------------------- 1 | 2 | ##### 1 sandbox-message 3 | ``` 4 | rocketmq 消息实践 5 | rabbitmq 消息实践 6 | zxing 二维码生成和条形码生成 7 | 8 | 9 | ``` 10 | 11 | ##### 2 sandbox-flex 12 | ``` 13 | mybatis-flex orm 框架实践 14 | 15 | 16 | ``` 17 | 18 | ##### 3 product-server 19 | ``` 20 | 21 | 22 | ``` 23 | 24 | 25 | ##### 5 sandbox-stock 26 | 27 | ```mysql 28 | 29 | select id, name, amount, current, eps, float_market_capital,pb_ttm, pe_ttm, percent, high_year, low_year, dividend_yield, update_time 30 | from tb_stock_info where name in ("中国银行","建设银行","工商银行","农业银行") 31 | 32 | ``` 33 | 34 | 35 | ``` 36 | 用于编译项目中的Java源代码。它使用Java编译器将Java源代码编译成字节码,以便在Java虚拟机上运行。该插件可以在项目的pom.xml文件中配置,以指定编译器版本、编译选项等。在配置完成后,可以通过运行Maven的compile命令来执行编译操作 37 | 38 | verbose 39 | 这个参数会让编译器输出更多的信息,通常用于调试。当使用这个参数时,编译器会提供有关正在执行的每个步骤的详细信息 40 | -Xlint:all 41 | 这个参数用于启用所有编译器警告。Xlint 是一个非标准的选项,但许多 Java 编译器(如 Oracle 和 OpenJDK)都支持它。使用 -Xlint:all 会启用所有可用的编译器警告,这有助于发现代码中的潜在问题。 42 | deprecation 43 | 这个参数会启用对 Java 代码中使用的已弃用的 API 的警告。当一个类、方法或字段被标记为 @Deprecated 时,使用这个参数可以确保代码不会意外地使用这些已弃用的部分 44 | parameters 45 | 这个参数让编译器为方法参数生成名称。当使用这个参数时,方法参数的名称会被存储在字节码中,这样在反射时可以获取这些名称。这对于某些框架和库(如 Hibernate 和 JPA)特别有用,因为它们需要知道参数的名称 46 | 47 | 48 | 49 | ``` 50 | -------------------------------------------------------------------------------- /doc/0306.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedestiny/springboot-auth/72f7f52f02ddbd42bdba6678d784651084484894/doc/0306.md -------------------------------------------------------------------------------- /doc/0307.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedestiny/springboot-auth/72f7f52f02ddbd42bdba6678d784651084484894/doc/0307.md -------------------------------------------------------------------------------- /doc/doc20240228.md: -------------------------------------------------------------------------------- 1 | cpu 内存高升解决思路 2 | 3 | 1 cpu 上下文切换过多 4 | 操作系统需要保存当前任务状态,并加载新的任务状态,消耗时间和资源,任务切换而非任务执行消耗 5 | 文件io 网络io 锁等待 线程阻塞 触发上下文切换 6 | 7 | 2 cpu 资源过度消耗 8 | 系统创建大量的线程,或者线程占用资源无法被释放,比如死循环,cpu 利用率过高后会导致应用中的线程无法获得cpu的调度, 9 | 使用 top htop 命令查看系统的整体性能,cpu 使用率 内存使用率 jstack pid 获取java 线程中的堆栈信息,定位到哪些线程和代码消耗cpu 10 | 使用性能剖析工具 jprofiler visualvm 进行cpu 性能剖析 11 | 12 | 频繁GC 死循环 递归调用 复杂循环 13 | 系统没有问题,系统当前访问量过高而导致系统资源不够 14 | -------------------------------------------------------------------------------- /doc/protobuf_learn.md: -------------------------------------------------------------------------------- 1 | 2 | ``` 3 | 4 | 引入依赖 5 | 6 | com.google.protobuf 7 | protobuf-java 8 | 3.24.0 9 | 10 | 11 | 12 | com.google.protobuf 13 | protobuf-java-util 14 | 3.24.0 15 | 16 | 17 | # 生成 java 文件 18 | protoc --java_out=. student.proto 19 | 20 | java_out 21 | python_out 22 | cpp_out 23 | go_out 24 | 25 | 26 | ``` -------------------------------------------------------------------------------- /doc/python_learn.md: -------------------------------------------------------------------------------- 1 | 2 | ``` 3 | 4 | python 错误或异常分类 raise 5 | https://blog.csdn.net/qq_29864051/article/details/131354326 6 | 7 | 8 | ``` 9 | -------------------------------------------------------------------------------- /git-flow-plus.config: -------------------------------------------------------------------------------- 1 | {"dingtalkToken":"","featurePrefix":"feature/","hotfixPrefix":"hotfix/","language":"CN","masterBranch":"master","releaseBranch":"release","releaseFinishIsDeleteFeature":false,"releaseFinishIsDeleteRelease":false,"tagPrefix":"","testBranch":"test"} 2 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/OrderServerApplication.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 7 | import org.springframework.scheduling.annotation.EnableAsync; 8 | import org.springframework.scheduling.annotation.EnableScheduling; 9 | 10 | /** 11 | * 开启事务 开启异步任务 开启定时任务 12 | */ 13 | @Slf4j 14 | @EnableScheduling 15 | @EnableAsync 16 | @EnableDiscoveryClient 17 | @SpringBootApplication 18 | public class OrderServerApplication { 19 | 20 | public static void main(String[] args) { 21 | log.info("start order! "); 22 | SpringApplication.run(OrderServerApplication.class, args); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/config/AppKeyConfig.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.context.annotation.PropertySource; 7 | 8 | import java.util.Map; 9 | 10 | /** 11 | * @Description appId-客户端公钥配置 12 | * @Author liangkaiyang 13 | * @Date 2023-06-28 3:11 PM 14 | */ 15 | @Data 16 | @Configuration 17 | @ConfigurationProperties(prefix = "app") 18 | @PropertySource(value = "classpath:pub_pri_key.properties", encoding = "UTF-8") 19 | public class AppKeyConfig { 20 | 21 | //--------------- 服务端配置客户端公钥 --------------------- 22 | private Map keys; 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/config/AppRequestIdGenerator.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.config; 2 | 3 | import cn.hutool.core.lang.Snowflake; 4 | import com.yomahub.liteflow.flow.id.RequestIdGenerator; 5 | import lombok.Data; 6 | 7 | @Data 8 | public class AppRequestIdGenerator implements RequestIdGenerator { 9 | 10 | // com.platform.orderserver.config.AppRequestIdGenerator 11 | public static final Snowflake flake = new Snowflake(); 12 | 13 | @Override 14 | public String generate() { 15 | return flake.nextIdStr(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/config/PriPubKeyConfig.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.context.annotation.PropertySource; 7 | 8 | import java.io.Serializable; 9 | 10 | /** 11 | * @Description 12 | * @Date 2023-06-27 6:32 PM 13 | */ 14 | @Data 15 | @Configuration 16 | @PropertySource(value = "classpath:pub_pri_key.properties", encoding = "UTF-8") 17 | public class PriPubKeyConfig implements Serializable { 18 | 19 | // 服务端 20 | @Value("${server.pubkey}") 21 | private String serverPubKey; 22 | 23 | @Value("${server.prikey}") 24 | private String serverPriKey; 25 | 26 | // 客户端 27 | @Value("${client.pubkey}") 28 | private String clientPubKey; 29 | 30 | @Value("${client.prikey}") 31 | private String clientPriKey; 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/dto/DataReq.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | @Data 8 | public class DataReq implements Serializable { 9 | 10 | /** 11 | * 应用密文 12 | */ 13 | private String appId; 14 | 15 | /** 16 | * 加密报文 17 | */ 18 | private String encrypt; 19 | /** 20 | * 签名 21 | */ 22 | private String sign; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/dto/OrderInfoDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.dto; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * @Description 7 | * @Author liangkaiyang 8 | * @Date 2025-05-28 6:30 PM 9 | */ 10 | 11 | @Data 12 | public class OrderInfoDto { 13 | 14 | 15 | // 订单号 16 | private String orderNo; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/dto/OrderInfoReq.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @Description 9 | * @Author liangkaiyang 10 | * @Date 2025-05-28 6:16 PM 11 | */ 12 | 13 | @Data 14 | public class OrderInfoReq implements Serializable { 15 | 16 | 17 | private String consumerId; 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/dto/PayDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.math.BigDecimal; 6 | 7 | @Data 8 | public class PayDto { 9 | 10 | /** 11 | * 商品信息 12 | */ 13 | private String subject; 14 | /** 15 | * 商品金额 16 | */ 17 | private BigDecimal amount; 18 | 19 | /** 20 | * storeId 21 | */ 22 | private String storeId; 23 | 24 | /** 25 | * 订单号 26 | */ 27 | private String orderNo; 28 | 29 | /** 30 | * 支付方式 1 支付宝 2 微信 3 银联 31 | */ 32 | private Integer payType; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/dto/PayResp.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 9 | * 10 | */ 11 | 12 | @Data 13 | public class PayResp implements Serializable { 14 | 15 | private static final long serialVersionUID = -433134976441618568L; 16 | // 订单号 17 | private String orderNo; 18 | 19 | // 支付链接 20 | private String codeUrl; 21 | 22 | private String imageUrl; 23 | 24 | private String payType; 25 | 26 | 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/dto/RefundInfoDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.math.BigDecimal; 7 | 8 | /** 9 | * 退款信息对象 10 | */ 11 | @Data 12 | public class RefundInfoDto implements Serializable { 13 | 14 | private static final long serialVersionUID = 3048710231855541292L; 15 | 16 | private Long id; 17 | 18 | private String orderNo; 19 | 20 | private String status; 21 | 22 | /** 23 | * 退款单 24 | */ 25 | private String refundNo; 26 | 27 | 28 | /** 29 | * 支付方式 30 | */ 31 | private String payType; 32 | 33 | /** 34 | * 退款原因 35 | */ 36 | private String reason; 37 | 38 | 39 | /** 40 | * 退款金额交易金额 41 | */ 42 | private BigDecimal amount; 43 | 44 | /** 45 | * 原订单金额 46 | */ 47 | private BigDecimal orderAmount; 48 | 49 | /** 50 | * 退款实体报文 51 | */ 52 | private String content; 53 | 54 | 55 | 56 | 57 | 58 | } 59 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/entity/Order.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.entity; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | 8 | /** 9 | * @Description 10 | * @Author kaiyang 11 | * @Date 2023-07-14 5:14 PM 12 | */ 13 | @Data 14 | public class Order implements Serializable { 15 | 16 | private Long id; 17 | 18 | private String orderNo; 19 | 20 | private Integer status; 21 | 22 | private Date createTime; 23 | 24 | private Date updateTime; 25 | } 26 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/flownode/AppFlowContext.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.flownode; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AppFlowContext { 7 | 8 | 9 | } 10 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/flownode/AppFlowDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.flownode; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AppFlowDto { 7 | 8 | // 业务id 9 | private String busId; 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/flownode/app/PrepareTrade.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.flownode.app; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | 5 | import com.platform.orderserver.flownode.AppFlowContext; 6 | import com.platform.orderserver.flownode.AppFlowDto; 7 | import com.yomahub.liteflow.core.NodeComponent; 8 | import lombok.extern.slf4j.Slf4j; 9 | import org.springframework.stereotype.Component; 10 | 11 | 12 | 13 | /** 14 | * @Description 数据准备和校验处理 15 | * @Date 2023-03-31 2:32 PM 16 | */ 17 | 18 | @Slf4j 19 | @Component(value = "prepareTrade") 20 | public class PrepareTrade extends NodeComponent { 21 | 22 | @Override 23 | public void process() throws Exception { 24 | 25 | log.info("交易完成后业务处理数据准备和校验"); 26 | //拿到请求参数 27 | AppFlowDto req = this.getSlot().getRequestData(); 28 | log.info("请求参数 {}", JSONObject.toJSONString(req)); 29 | // 停止任务 30 | // setIsEnd(Boolean.TRUE); 31 | AppFlowContext context = this.getContextBean(AppFlowContext.class); 32 | log.info("设置上下文对象 {}", JSONObject.toJSONString(context)); 33 | } 34 | 35 | 36 | } 37 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/flownode/app/SendEmail.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.flownode.app; 2 | 3 | import cn.hutool.core.util.RandomUtil; 4 | import com.yomahub.liteflow.core.NodeComponent; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.stereotype.Component; 7 | 8 | import java.util.concurrent.TimeUnit; 9 | 10 | 11 | @Slf4j 12 | @Component(value = "sendEmail") 13 | public class SendEmail extends NodeComponent { 14 | 15 | @Override 16 | public void process() throws Exception { 17 | TimeUnit.SECONDS.sleep(RandomUtil.randomInt(0, 20)); 18 | log.info("handle send email !"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/flownode/app/SendMq.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.flownode.app; 2 | 3 | import cn.hutool.core.util.RandomUtil; 4 | import com.yomahub.liteflow.core.NodeComponent; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.stereotype.Component; 7 | 8 | import java.util.concurrent.TimeUnit; 9 | 10 | /** 11 | * 发送mq 业务 12 | */ 13 | @Slf4j 14 | @Component(value = "sendMq") 15 | public class SendMq extends NodeComponent { 16 | @Override 17 | public void process() throws Exception { 18 | TimeUnit.SECONDS.sleep(RandomUtil.randomInt(0, 20)); 19 | log.info("handle send mq !"); 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/flownode/app/SendPhone.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.flownode.app; 2 | 3 | import cn.hutool.core.util.RandomUtil; 4 | import com.yomahub.liteflow.core.NodeComponent; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.stereotype.Component; 7 | 8 | import java.util.concurrent.TimeUnit; 9 | 10 | @Slf4j 11 | @Component(value = "sendPhone") 12 | public class SendPhone extends NodeComponent { 13 | @Override 14 | public void process() throws Exception { 15 | TimeUnit.SECONDS.sleep(RandomUtil.randomInt(0, 20)); 16 | log.info("handle send phone !"); 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/mapper/OrderMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.mapper; 2 | 3 | import com.platform.orderserver.entity.Order; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * @Description 9 | * @Author kaiyang 10 | * @Date 2023-07-14 5:16 PM 11 | */ 12 | public interface OrderMapper { 13 | 14 | 15 | /** 16 | * SELECT DATE_ADD(NOW(), INTERVAL 30 MINUTE); 当前时间加上 30分钟 17 | * SELECT DATE_SUB(NOW(), INTERVAL 30 MINUTE); 当前时间减去 30分钟 18 | * 查询30分钟前处理中或者待支付的订单 19 | * @param order 20 | * @return 21 | */ 22 | List selectOrderList(Order order); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/service/OrderService.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.service; 2 | 3 | import com.platform.authcommon.common.Result; 4 | import com.platform.orderserver.dto.OrderInfoDto; 5 | import com.platform.orderserver.dto.OrderInfoReq; 6 | 7 | /** 8 | * @Description 9 | * @Author liangkaiyang 10 | * @Date 2025-05-28 6:24 PM 11 | */ 12 | public interface OrderService { 13 | 14 | /** 15 | * 创建订单 16 | */ 17 | Result createOrder(OrderInfoReq infoReq); 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/service/impl/OrderServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.service.impl; 2 | 3 | import com.platform.authcommon.common.Result; 4 | import com.platform.orderserver.dto.OrderInfoDto; 5 | import com.platform.orderserver.dto.OrderInfoReq; 6 | import com.platform.orderserver.service.OrderService; 7 | import lombok.extern.slf4j.Slf4j; 8 | import org.springframework.stereotype.Service; 9 | 10 | /** 11 | * @Description 12 | * @Author liangkaiyang 13 | * @Date 2025-05-28 6:26 PM 14 | */ 15 | 16 | @Slf4j 17 | @Service 18 | public class OrderServiceImpl implements OrderService { 19 | 20 | 21 | @Override 22 | public Result createOrder(OrderInfoReq infoReq) { 23 | return null; 24 | } 25 | 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/stragey/AlipayAppBusiness.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.stragey; 2 | 3 | import cn.hutool.core.util.RandomUtil; 4 | import com.platform.orderserver.dto.PayDto; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.stereotype.Service; 7 | 8 | import java.util.concurrent.TimeUnit; 9 | 10 | /** 11 | * @Description 支付宝业务 12 | * @Author liangkaiyang 13 | * @Date 2023-08-02 4:36 PM 14 | */ 15 | 16 | @Slf4j 17 | @Service(value = "alipayAppBusiness") 18 | public class AlipayAppBusiness extends AbstractAppBusiness implements BaseBusiness { 19 | 20 | 21 | @Override 22 | protected boolean doPay(PayDto pay) { 23 | try { 24 | TimeUnit.MILLISECONDS.sleep(RandomUtil.randomInt(200, 1000)); 25 | } catch (InterruptedException e) { 26 | e.printStackTrace(); 27 | } 28 | log.info("支付宝支付业务流程"); 29 | return true; 30 | } 31 | 32 | @Override 33 | public boolean sendEmail(PayDto pay) { 34 | return super.sendEmail(pay); 35 | } 36 | 37 | @Override 38 | public boolean sendPhone(PayDto pay) { 39 | return super.sendPhone(pay); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/stragey/BaseBusiness.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.stragey; 2 | 3 | import com.platform.authcommon.common.Result; 4 | import com.platform.orderserver.dto.PayDto; 5 | 6 | /** 7 | * @Description 业务接口类 8 | * @Author liangkaiyang 9 | * @Date 2023-08-02 4:32 PM 10 | */ 11 | public interface BaseBusiness { 12 | 13 | /** 14 | * 处理业务流程 15 | */ 16 | Result handleOrderFlow(PayDto pay); 17 | 18 | // 发送邮件 19 | boolean sendEmail(PayDto pay); 20 | 21 | // 发送手机短信 22 | boolean sendPhone(PayDto pay); 23 | } 24 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/stragey/PayContext.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.stragey; 2 | 3 | import com.platform.authcommon.common.Result; 4 | import com.platform.orderserver.dto.PayDto; 5 | 6 | /** 7 | * 策略模式的上下文 8 | */ 9 | public class PayContext { 10 | 11 | 12 | private BaseBusiness business; 13 | 14 | public PayContext(BaseBusiness bus){ 15 | this.business = bus; 16 | } 17 | 18 | // 19 | public boolean sendEmail(PayDto pay){ 20 | return business.sendEmail(pay); 21 | } 22 | 23 | boolean sendPhone(PayDto pay){ 24 | return business.sendPhone(pay); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/stragey/UnionPayAppBusiness.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.stragey; 2 | 3 | import cn.hutool.core.util.RandomUtil; 4 | import com.platform.orderserver.dto.PayDto; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.stereotype.Service; 7 | 8 | import java.util.concurrent.TimeUnit; 9 | 10 | /** 11 | * @Description 12 | * @Author liangkaiyang 13 | * @Date 2023-08-02 4:36 PM 14 | */ 15 | 16 | @Slf4j 17 | @Service 18 | public class UnionPayAppBusiness extends AbstractAppBusiness implements BaseBusiness { 19 | 20 | 21 | @Override 22 | protected boolean doPay(PayDto pay) { 23 | try { 24 | TimeUnit.MILLISECONDS.sleep(RandomUtil.randomInt(200, 1000)); 25 | } catch (InterruptedException e) { 26 | e.printStackTrace(); 27 | } 28 | log.info("银联支付业务流程"); 29 | return true; 30 | } 31 | 32 | @Override 33 | public boolean sendEmail(PayDto pay) { 34 | return super.sendEmail(pay); 35 | } 36 | 37 | @Override 38 | public boolean sendPhone(PayDto pay) { 39 | return super.sendPhone(pay); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/stragey/WeixinAppBusiness.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.stragey; 2 | 3 | import cn.hutool.core.util.RandomUtil; 4 | import com.platform.orderserver.dto.PayDto; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.stereotype.Service; 7 | 8 | import java.util.concurrent.TimeUnit; 9 | 10 | /** 11 | * @Description 12 | * @Author liangkaiyang 13 | * @Date 2023-08-02 4:36 PM 14 | */ 15 | 16 | @Slf4j 17 | @Service 18 | public class WeixinAppBusiness extends AbstractAppBusiness implements BaseBusiness { 19 | 20 | 21 | @Override 22 | protected boolean doPay(PayDto pay) { 23 | try { 24 | TimeUnit.MILLISECONDS.sleep(RandomUtil.randomInt(200, 1000)); 25 | } catch (InterruptedException e) { 26 | e.printStackTrace(); 27 | } 28 | log.info("微信支付业务流程"); 29 | return true; 30 | } 31 | 32 | @Override 33 | public boolean sendEmail(PayDto pay) { 34 | return super.sendEmail(pay); 35 | } 36 | 37 | @Override 38 | public boolean sendPhone(PayDto pay) { 39 | return super.sendPhone(pay); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/utils/GsonUtil.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.utils; 2 | 3 | import com.google.common.reflect.TypeToken; 4 | import com.google.gson.Gson; 5 | import com.google.gson.GsonBuilder; 6 | import lombok.extern.slf4j.Slf4j; 7 | 8 | import java.util.Map; 9 | 10 | @Slf4j 11 | public class GsonUtil { 12 | 13 | public static final Gson gson = new GsonBuilder().disableHtmlEscaping().create(); 14 | 15 | public static String toJsonString(Object obj) { 16 | return gson.toJson(obj); 17 | } 18 | 19 | public static Map fromJson2Map(String obj) { 20 | TypeToken> mapTypeToken = new TypeToken>() { 21 | }; 22 | return fromJson2Type(obj, mapTypeToken); 23 | } 24 | 25 | public static T fromJson2Type(String obj, TypeToken typeToken) { 26 | return gson.fromJson(obj, typeToken.getType()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/utils/IdGenUtils.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.utils; 2 | 3 | import cn.hutool.core.lang.Snowflake; 4 | import lombok.extern.slf4j.Slf4j; 5 | 6 | /** 7 | * @Description 8 | * @Author liangkaiyang 9 | * @Date 2025-05-28 6:11 PM 10 | */ 11 | 12 | @Slf4j 13 | public class IdGenUtils { 14 | 15 | // 1, 1 16 | // 终端ID workerId, 数据中心ID dataCenterId 17 | private static final Snowflake SNOWFLAKE = new Snowflake(); 18 | 19 | // 生成订单号 20 | public static String genOrderNo() { 21 | return "ORDER_" + SNOWFLAKE.nextIdStr(); 22 | } 23 | 24 | // 生成唯一请求号 25 | public static String genRequestId() { 26 | return SNOWFLAKE.nextIdStr(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/utils/WxApiType.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.utils; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | /** 7 | * 微信支付接口 8 | */ 9 | @AllArgsConstructor 10 | @Getter 11 | public enum WxApiType { 12 | 13 | // Native下单 14 | NATIVE_PAY("/v3/pay/transactions/native"), 15 | // 查询订单 16 | ORDER_QUERY_BY_NO("/v3/pay/transactions/out-trade-no/%s"), 17 | // 关闭订单 18 | CLOSE_ORDER_BY_NO("/v3/pay/transactions/out-trade-no/%s/close"), 19 | //申请退款 20 | DOMESTIC_REFUNDS("/v3/refund/domestic/refunds"), 21 | // 查询单笔退款 22 | DOMESTIC_REFUNDS_QUERY("/v3/refund/domestic/refunds/%s"), 23 | 24 | /** 25 | * 申请交易账单 26 | */ 27 | TRADE_BILLS("/v3/bill/tradebill"), 28 | 29 | /** 30 | * 申请资金账单 31 | */ 32 | FUND_FLOW_BILLS("/v3/bill/fundflowbill"), 33 | 34 | /** 35 | * Native下单V2 36 | */ 37 | NATIVE_PAY_V2("/pay/unifiedorder"), 38 | 39 | ; 40 | 41 | 42 | /** 43 | * 类型 44 | */ 45 | private final String type; 46 | } 47 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/platform/orderserver/utils/WxNotifyType.java: -------------------------------------------------------------------------------- 1 | package com.platform.orderserver.utils; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | @AllArgsConstructor 7 | @Getter 8 | public enum WxNotifyType { 9 | 10 | /** 11 | * 支付通知 12 | */ 13 | NATIVE_NOTIFY("/api/weixin/order/notify"), 14 | 15 | /** 16 | * 支付通知V2 17 | */ 18 | NATIVE_NOTIFY_V2("/api/wx-pay-v2/native/notify"), 19 | 20 | 21 | /** 22 | * 退款结果通知 23 | */ 24 | REFUND_NOTIFY("/api/weixin/refund/notify"); 25 | 26 | /** 27 | * 类型 28 | */ 29 | private final String type; 30 | } 31 | -------------------------------------------------------------------------------- /order-server/src/main/resources/application-dev.yml: -------------------------------------------------------------------------------- 1 | liteflow: 2 | # 规则文件 失败重试次数 打印执行日志 监控日志 3 | ruleSource : liteflow/*.el.xml 4 | retry-count: 0 5 | print-execution-log: true 6 | monitor: 7 | enable-log: true 8 | period: 300000 9 | request-id-generator-class: com.platform.orderserver.config.AppRequestIdGenerator 10 | # 上下文的最大数量槽 11 | slot-size : 10240 12 | # 线程数,默认为64 13 | main-executor-works: 64 14 | # 异步线程最长等待时间 秒 15 | when-max-wait-seconds: 15 16 | # when 节点全局异步线程池最大线程数 17 | when-max-workers: 16 18 | # when 节点全局异步线程池队列数 19 | when-queue-limit: 5120 20 | # 在启动的时候就解析规则 21 | parse-on-start: true 22 | enable: true 23 | 24 | -------------------------------------------------------------------------------- /order-server/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | profiles: 3 | active: dev 4 | application: 5 | name: order-server 6 | cloud: 7 | nacos: 8 | discovery: 9 | server-addr: localhost:8848 10 | namespace: 163c702f-c805-42f2-a1e1-a491f086f3a2 11 | group: springboot-oauth 12 | 13 | 14 | server: 15 | port: 9301 16 | 17 | # 微信支付配置 18 | app: 19 | wxpay: 20 | mch-id: mcd_id 21 | mch-serial-no: serial_no 22 | private-key-path: apiclient_key.pem 23 | api-v3-key: v3_key 24 | appid: app_id 25 | domain: https://api.mch.weixin.qq.com 26 | notify-domain: https://www.return.com 27 | partner-key: parter_key 28 | 29 | 30 | alipay: 31 | private-key: xxx 32 | app-cert-path : xx 33 | alipay-cert-path: xx 34 | alipay-root-cert-path: xx 35 | app-id: xx 36 | notify: xx 37 | charset: UTF-8 38 | sign-type: RSA2 39 | format: json 40 | gateway: https://openapi.alipay.com/gateway.do 41 | -------------------------------------------------------------------------------- /order-server/src/main/resources/liteflow/test_flow.el.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | THEN( 5 | prepareTrade, grantScore, sendMq, WHEN(sendEmail, sendPhone) 6 | ); 7 | 8 | 9 | -------------------------------------------------------------------------------- /order-server/src/main/resources/mapper/BoardMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | id, 17 | `order_no`, `status`, create_time, update_time 18 | 19 | 20 | 21 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/business/StockBusiness.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.business; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.stereotype.Component; 5 | 6 | /** 7 | * @Description stock 信息 8 | * @Date 2023-08-16 11:37 AM 9 | */ 10 | 11 | @Slf4j 12 | @Component 13 | public class StockBusiness { 14 | 15 | 16 | 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/config/AppBusinessAspect.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.config; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.aspectj.lang.ProceedingJoinPoint; 5 | import org.aspectj.lang.annotation.Around; 6 | import org.aspectj.lang.annotation.Aspect; 7 | import org.aspectj.lang.annotation.Pointcut; 8 | import org.aspectj.lang.reflect.MethodSignature; 9 | import org.springframework.stereotype.Component; 10 | 11 | import java.lang.reflect.Method; 12 | 13 | /** 14 | * @Description 15 | * @Date 2023-12-22 5:11 下午 16 | */ 17 | @Aspect 18 | @Component 19 | @Slf4j 20 | public class AppBusinessAspect { 21 | 22 | @Pointcut("@annotation(com.platform.productserver.config.Business)") 23 | public void lockPoint() {} 24 | 25 | 26 | @Around("lockPoint()") 27 | public Object around(ProceedingJoinPoint pjp) throws Throwable { 28 | Method method = ((MethodSignature) pjp.getSignature()).getMethod(); 29 | Business distributedLock = method.getAnnotation(Business.class); 30 | // todo business 31 | return pjp.proceed(); 32 | 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/config/AppRequestInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.config; 2 | 3 | import feign.RequestInterceptor; 4 | import feign.RequestTemplate; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.stereotype.Component; 7 | 8 | 9 | /** 10 | * openfeign 添加请求头 11 | */ 12 | @Slf4j 13 | @Component 14 | public class AppRequestInterceptor implements RequestInterceptor { 15 | 16 | 17 | @Override 18 | public void apply(RequestTemplate template) { 19 | // feign 调用添加请求头 20 | template.header("app-server","product-server"); 21 | } 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/config/ApplicationContextHolder.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.config; 2 | 3 | import org.springframework.beans.BeansException; 4 | import org.springframework.context.ApplicationContext; 5 | import org.springframework.context.ApplicationContextAware; 6 | import org.springframework.core.Ordered; 7 | import org.springframework.stereotype.Component; 8 | 9 | /** 10 | * 提供全局获取AppContext的方法 11 | */ 12 | 13 | @Component 14 | public class ApplicationContextHolder implements ApplicationContextAware, Ordered { 15 | 16 | private static ApplicationContext applicationContext; 17 | 18 | @Override 19 | public void setApplicationContext(ApplicationContext context) throws BeansException { 20 | ApplicationContextHolder.applicationContext = context; 21 | } 22 | 23 | public static ApplicationContext get() { 24 | return applicationContext; 25 | } 26 | 27 | @Override 28 | public int getOrder() { 29 | return Integer.MAX_VALUE; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/config/AuthConfig.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.stereotype.Component; 6 | 7 | @Data 8 | @Component 9 | @ConfigurationProperties(prefix = "app.security.oauth2") 10 | public class AuthConfig { 11 | 12 | public String clientId; 13 | 14 | public String clientSecret; 15 | 16 | public String tokenInfoUri; 17 | 18 | public String accessTokenUri; 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/config/Business.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.config; 2 | 3 | 4 | import java.lang.annotation.Documented; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Documented 10 | public @interface Business { 11 | 12 | 13 | } 14 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/config/MyMetaObjectHandler.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.config; 2 | 3 | import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; 4 | import lombok.Data; 5 | import org.apache.ibatis.reflection.MetaObject; 6 | import org.springframework.stereotype.Component; 7 | 8 | import java.util.Date; 9 | 10 | 11 | /** 12 | * mybatis- Filed Fill 13 | */ 14 | @Data 15 | @Component 16 | public class MyMetaObjectHandler implements MetaObjectHandler { 17 | 18 | 19 | @Override 20 | public void insertFill(MetaObject metaObject) { 21 | this.strictInsertFill(metaObject, "createTime", Date.class, new Date()); 22 | this.strictInsertFill(metaObject, "updateTime", Date.class, new Date()); 23 | this.strictInsertFill(metaObject, "seq", Long.class, 0L); 24 | } 25 | 26 | @Override 27 | public void updateFill(MetaObject metaObject) { 28 | this.strictUpdateFill(metaObject, "updateTime", Date.class, new Date()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/config/ProductAppConfig.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.config; 2 | 3 | 4 | import lombok.Data; 5 | import org.springframework.boot.SpringBootConfiguration; 6 | import org.springframework.boot.context.properties.ConfigurationProperties; 7 | 8 | @Data 9 | @SpringBootConfiguration 10 | @ConfigurationProperties(prefix = "app") 11 | public class ProductAppConfig { 12 | 13 | private String name; 14 | 15 | private Integer age; 16 | 17 | private String address; 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/dto/AccountDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | @Data 8 | public class AccountDto implements Serializable { 9 | 10 | private static final long serialVersionUID = -6749243131059493189L; 11 | 12 | /** 13 | * 用户id 14 | */ 15 | private String userId; 16 | 17 | /** 18 | * 账户类型 账户类型:10-内部、11-外部、12-管理 19 | */ 20 | private Integer accountType; 21 | 22 | 23 | 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/dto/BaseNode.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @Description 9 | * @Date 2023-09-20 5:12 PM 10 | */ 11 | 12 | @Data 13 | public class BaseNode implements Serializable { 14 | 15 | 16 | 17 | private String requestNo; 18 | 19 | private Integer status; 20 | 21 | private String error; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/dto/BatchTradeDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.dto; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import javax.validation.constraints.NotEmpty; 7 | import java.io.Serializable; 8 | import java.math.BigDecimal; 9 | import java.util.List; 10 | 11 | /** 12 | * @Description 批量操作对象 13 | * @Date 2023-09-19 2:25 PM 14 | */ 15 | @Data 16 | public class BatchTradeDto implements Serializable { 17 | 18 | private static final long serialVersionUID = 592624151719492769L; 19 | 20 | @ApiModelProperty(value = "商户号") 21 | private String merchantNo; 22 | 23 | @ApiModelProperty(value = "账户类型") 24 | private Integer accountType; 25 | 26 | // 记否记录欠款 27 | private Boolean credit = false; 28 | 29 | // 交易金额 30 | @ApiModelProperty(value = "交易总金额") 31 | private BigDecimal amount; 32 | 33 | // 交易金额 34 | @ApiModelProperty(value = "交易金额") 35 | @NotEmpty(message = "交易列表不能为空") 36 | private List tradeList; 37 | 38 | 39 | 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/dto/BatchTradeResp.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.List; 7 | 8 | /** 9 | * 批量操作对象返回 10 | * @Description 11 | * @Date 2023-09-20 4:48 PM 12 | */ 13 | 14 | @Data 15 | public class BatchTradeResp implements Serializable { 16 | 17 | 18 | private static final long serialVersionUID = 4162685945481542445L; 19 | 20 | private List dataList; 21 | 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/dto/DataNode.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @Description 9 | * @Date 2023-12-14 3:42 下午 10 | */ 11 | 12 | @Data 13 | public class DataNode implements Serializable { 14 | 15 | private String userId; 16 | 17 | private String articleId; 18 | 19 | private String time; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/dto/FreezeTradeDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.dto; 2 | 3 | 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | import org.hibernate.validator.constraints.Length; 7 | 8 | import javax.validation.constraints.Digits; 9 | import javax.validation.constraints.NotBlank; 10 | import javax.validation.constraints.NotNull; 11 | import java.io.Serializable; 12 | import java.math.BigDecimal; 13 | 14 | /** 15 | * 冻结操作 16 | */ 17 | @Data 18 | public class FreezeTradeDto extends FreezeDto implements Serializable { 19 | 20 | private static final long serialVersionUID = 8380399281324399606L; 21 | 22 | @ApiModelProperty("对方账户") 23 | private String otherAccount; 24 | 25 | @ApiModelProperty("对方账户类型") 26 | private Integer otherAccountType; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/dto/MenuDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.dto; 2 | 3 | 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | public class MenuDto { 10 | 11 | 12 | private Integer id; 13 | 14 | /** 15 | * 菜单名称 16 | */ 17 | private String name; 18 | 19 | /** 20 | * 序号 21 | */ 22 | private Integer seq; 23 | 24 | /** 25 | * 父级id 26 | */ 27 | private Integer parentId; 28 | 29 | /** 30 | * 子节点列表 31 | */ 32 | private List children; 33 | 34 | 35 | public MenuDto(Integer id, String name, Integer parentId) { 36 | this.id = id; 37 | this.name = name; 38 | this.parentId = parentId; 39 | } 40 | 41 | public MenuDto() { 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/dto/MerchantDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @Description 商户账户 9 | * @Date 2023-08-30 2:36 PM 10 | */ 11 | @Data 12 | public class MerchantDto implements Serializable { 13 | 14 | private static final long serialVersionUID = -3020480500850328011L; 15 | 16 | /** 17 | * 商户号 18 | */ 19 | private String merchantNo; 20 | 21 | /** 22 | * 账户类型 账户类型:30-发放账户 31-商户账户 32-结算账户 23 | */ 24 | private Integer accountType; 25 | 26 | private String source; 27 | 28 | private String prodType; 29 | 30 | 31 | public static void main(String[] args) { 32 | 33 | String tdd = "1"; 34 | String txt = "中"; 35 | 36 | System.out.println(tdd.length()); 37 | System.out.println(txt.length()); 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/dto/StockCompDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.dto; 2 | 3 | import com.platform.productserver.entity.StockInfo; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.math.BigDecimal; 8 | import java.util.List; 9 | 10 | /** 11 | * @Description stock 对比 12 | * @Date 2023-08-24 3:15 PM 13 | */ 14 | 15 | @Data 16 | public class StockCompDto implements Serializable { 17 | 18 | private static final long serialVersionUID = 3354872856655422759L; 19 | 20 | private String code; 21 | 22 | private String name; 23 | 24 | private BigDecimal price; 25 | 26 | private BigDecimal rate; 27 | 28 | private List list; 29 | 30 | public StockCompDto(String code, String name) { 31 | this.code = code; 32 | this.name = name; 33 | } 34 | public StockCompDto(String code, String name,List list ) { 35 | this.code = code; 36 | this.name = name; 37 | this.list = list; 38 | } 39 | 40 | public StockCompDto() { 41 | } 42 | 43 | public static void main(String[] args) { 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/dto/UserDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.math.BigDecimal; 7 | import java.util.List; 8 | 9 | /** 10 | * 用户信息 11 | */ 12 | @Data 13 | public class UserDto implements Serializable { 14 | 15 | private static final long serialVersionUID = -5523990557643918662L; 16 | 17 | private Long id; 18 | 19 | private String username; 20 | 21 | private String password; 22 | 23 | private List roles; 24 | 25 | private BigDecimal weight; 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/entity/Freeze.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.entity; 2 | 3 | import java.math.BigDecimal; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.baomidou.mybatisplus.annotation.IdType; 6 | import com.baomidou.mybatisplus.annotation.TableId; 7 | import java.io.Serializable; 8 | 9 | import com.platform.authcommon.base.BaseEntity; 10 | import lombok.Data; 11 | import lombok.EqualsAndHashCode; 12 | 13 | /** 14 | *

15 | * 专款冻结表 16 | *

17 | * 18 | * @author destiny 19 | * @since 2023-08-20 20 | */ 21 | @Data 22 | @EqualsAndHashCode(callSuper = false) 23 | @TableName("tb_freeze") 24 | public class Freeze extends BaseEntity implements Serializable { 25 | 26 | private static final long serialVersionUID = 5411920656490667304L; 27 | 28 | /** 29 | * ID 30 | */ 31 | @TableId(value = "id", type = IdType.AUTO) 32 | private Long id; 33 | 34 | /** 35 | * 账户ID 36 | */ 37 | private Long accountId; 38 | 39 | /** 40 | * 冻结类型:2-转账冻结、3-结算冻结 41 | */ 42 | private String freezeType; 43 | 44 | /** 45 | * 冻结金额 46 | */ 47 | private BigDecimal freezeAmount; 48 | 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/ext/PkgOutLogExt.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.ext; 2 | 3 | import com.platform.productserver.entity.PkgOutLog; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * @Description 10 | * @Date 2023-08-29 4:54 PM 11 | */ 12 | 13 | @Data 14 | public class PkgOutLogExt extends PkgOutLog implements Serializable { 15 | 16 | private static final long serialVersionUID = 274163106243424742L; 17 | 18 | // 查询数据量 19 | private Integer fetchSize; 20 | // 起始id 21 | private Long startId; 22 | } 23 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/grant/GiveRefundReq.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.grant; 2 | 3 | 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import java.io.Serializable; 8 | import java.math.BigDecimal; 9 | 10 | @Data 11 | public class GiveRefundReq implements Serializable { 12 | 13 | private static final long serialVersionUID = 699021280537226951L; 14 | 15 | @ApiModelProperty("原分发号") 16 | private String giveNo; 17 | 18 | @ApiModelProperty("撤回订单号") 19 | private String orderNo; 20 | 21 | @ApiModelProperty("撤回请求号") 22 | private String requestNo; 23 | 24 | @ApiModelProperty("撤回金额") 25 | private BigDecimal amount; 26 | 27 | @ApiModelProperty("备注") 28 | private String remark; 29 | 30 | @ApiModelProperty("摘要") 31 | private String summary; 32 | 33 | // 撤回类型 1:撤回并销毁 2:仅撤回到账户余额 34 | private Integer refundType; 35 | // 是否允许欠款 0-否 1-是 36 | private Integer allowDebit; 37 | 38 | 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/grant/GiveResp.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.grant; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import io.swagger.annotations.ApiOperation; 5 | import lombok.Data; 6 | 7 | import java.io.Serializable; 8 | 9 | @Data 10 | @ApiOperation(value = "积分分发-响应") 11 | public class GiveResp implements Serializable { 12 | 13 | private static final long serialVersionUID = 6988735868201041339L; 14 | 15 | @ApiModelProperty(value = "状态") 16 | private Integer status; 17 | 18 | @ApiModelProperty(value = "订单号") 19 | private String orderNo; 20 | 21 | @ApiModelProperty("请求号") 22 | private String requestNo; 23 | 24 | @ApiModelProperty("批次号") 25 | private String batchNo; 26 | 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/grant/GrantContext.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.grant; 2 | 3 | import com.platform.productserver.entity.BtransLog; 4 | import com.platform.productserver.entity.CtransLog; 5 | import com.platform.productserver.entity.GiveBatchInfo; 6 | import com.platform.productserver.entity.GiveLog; 7 | import lombok.Data; 8 | 9 | import java.io.Serializable; 10 | import java.util.List; 11 | 12 | /** 13 | * @Description 积分分发上下文 14 | * @Date 2023-09-18 5:01 PM 15 | */ 16 | @Data 17 | public class GrantContext implements Serializable { 18 | 19 | private static final long serialVersionUID = -6215186770229376280L; 20 | 21 | // 数据保存状态 22 | private Boolean saveFlag; 23 | 24 | private BatchGiveReq batchReq; 25 | 26 | // 批次信息 27 | private GiveBatchInfo batchInf; 28 | 29 | private List logs; 30 | 31 | private List userList; 32 | 33 | private List ctransLogs; 34 | 35 | private List btransLogs; 36 | 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/grant/hold.md: -------------------------------------------------------------------------------- 1 | 2 | 流浪地球,重核聚变,石头都可以当做燃料 3 | 4 | 信息与能力 5 | 天下苦秦久已 6 | 士气 人心皆在,需要一个火种 7 | 8 | 有技巧和能力,要有斗争的方法,发挥主观能动性,群策群力 9 | 不仅要知道为什么打仗,发挥个人最大潜力,有勇有谋 10 | 牺牲是在所难免。 11 | 保持信念,坚定信息。 12 | 13 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/mapper/AccountLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.mapper; 2 | 3 | import com.platform.productserver.entity.AccountLog; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 账户流水表 Mapper 接口 9 | *

10 | * 11 | * @author destiny 12 | * @since 2023-08-20 13 | */ 14 | public interface AccountLogMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/mapper/AccountMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.mapper; 2 | 3 | import com.platform.productserver.entity.Account; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | /** 8 | *

9 | * 用户账户表 Mapper 接口 10 | *

11 | * 12 | * @author destiny 13 | * @since 2023-08-20 14 | */ 15 | public interface AccountMapper extends BaseMapper { 16 | 17 | 18 | /** 19 | * 查询账户信息 20 | * @param userId 21 | * @param accountType 22 | * @return 23 | */ 24 | Account queryAccount(@Param("userId") String userId, @Param("accountType") Integer accountType); 25 | 26 | /** 27 | * 根据账户查询 28 | * @param accountId 29 | * @return 30 | */ 31 | Account queryAccountForUpdate(Long accountId); 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/mapper/BtransLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.mapper; 2 | 3 | import com.platform.productserver.entity.BtransLog; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.platform.productserver.entity.GiveLog; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * B端操作流水 Mapper 接口 12 | *

13 | * 14 | * @author destiny 15 | * @since 2023-09-17 16 | */ 17 | public interface BtransLogMapper extends BaseMapper { 18 | 19 | 20 | Integer insertEntityList(List logList); 21 | 22 | List selectLogListByFid(List idList); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/mapper/CtransLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.mapper; 2 | 3 | import com.platform.productserver.entity.CtransLog; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | *

10 | * C端操作流水 Mapper 接口 11 | *

12 | * 13 | * @author destiny 14 | * @since 2023-09-17 15 | */ 16 | public interface CtransLogMapper extends BaseMapper { 17 | 18 | 19 | Integer insertEntityList(List logList); 20 | 21 | /** 22 | * 根据 fid list 查询数据 23 | */ 24 | List selectLogListByFid(List idList); 25 | } 26 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/mapper/EtfInfoMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.mapper; 2 | 3 | import com.platform.productserver.entity.EtfInfo; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 基金基本信息表 Mapper 接口 9 | *

10 | * 11 | * @author destiny 12 | * @since 2023-08-25 13 | */ 14 | public interface EtfInfoMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/mapper/FreezeLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.mapper; 2 | 3 | import com.platform.productserver.entity.FreezeLog; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 冻结流水表 Mapper 接口 9 | *

10 | * 11 | * @author destiny 12 | * @since 2023-08-20 13 | */ 14 | public interface FreezeLogMapper extends BaseMapper { 15 | 16 | FreezeLog queryFreezeLog(String requestNo); 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/mapper/FreezeMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.mapper; 2 | 3 | import com.platform.productserver.entity.Freeze; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | /** 8 | *

9 | * 专款冻结表 Mapper 接口 10 | *

11 | * 12 | * @author destiny 13 | * @since 2023-08-20 14 | */ 15 | public interface FreezeMapper extends BaseMapper { 16 | 17 | 18 | /** 19 | * 根据账户id 和 冻结类型查询冻结账户 20 | */ 21 | Freeze queryFreezeAccount(@Param("accountId") Long id, @Param("freezeType") String activityType); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/mapper/FundInfoMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.mapper; 2 | 3 | import com.platform.productserver.entity.FundInfo; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | * 基金基本信息表 Mapper 接口 8 | */ 9 | public interface FundInfoMapper extends BaseMapper { 10 | 11 | /** 12 | * 保存基金信息 13 | */ 14 | Integer saveFundInfo(FundInfo fund); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/mapper/GiveBatchInfoMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.platform.productserver.entity.GiveBatchInfo; 5 | 6 | /** 7 | *

8 | * 积分分发信息表 Mapper 接口 9 | *

10 | * 11 | * @author destiny 12 | * @since 2023-09-11 13 | */ 14 | public interface GiveBatchInfoMapper extends BaseMapper { 15 | 16 | 17 | GiveBatchInfo selectBatchInfo(String batchNo); 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/mapper/GiveLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.platform.productserver.entity.GiveLog; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | *

10 | * 积分分发订单表 Mapper 接口 11 | *

12 | * 13 | * @author destiny 14 | * @since 2023-09-11 15 | */ 16 | public interface GiveLogMapper extends BaseMapper { 17 | 18 | /** 19 | * 批量保存日志信息 20 | * @param logList 21 | * @return 22 | */ 23 | Integer insertEntityList(List logList); 24 | 25 | /** 26 | * 根据请求号查询数据 27 | */ 28 | GiveLog selectByGiveNo(String giveNo); 29 | 30 | /** 31 | * 根据批次号查询一批数据 32 | */ 33 | List selectByBatchNo(String batchNo); 34 | } 35 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/mapper/GiveRefundLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.platform.productserver.entity.GiveRefundLog; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | *

10 | * 发放撤回表 Mapper 接口 11 | *

12 | * 13 | * @author destiny 14 | * @since 2023-09-11 15 | */ 16 | public interface GiveRefundLogMapper extends BaseMapper { 17 | 18 | 19 | List selectByRefundNo(String giveNo); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/mapper/MenuMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.mapper; 2 | 3 | import com.platform.productserver.entity.Menu; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 菜单表 Mapper 接口 9 | *

10 | * 11 | * @author destiny 12 | * @since 2023-09-13 13 | */ 14 | public interface MenuMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/mapper/MerchantLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.mapper; 2 | 3 | import com.platform.productserver.entity.MerchantLog; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | *

10 | * 商户账户流水表 Mapper 接口 11 | *

12 | * 13 | * @author destiny 14 | * @since 2023-08-20 15 | */ 16 | public interface MerchantLogMapper extends BaseMapper { 17 | 18 | Integer insertEntityList(List logList); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/mapper/MerchantMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.mapper; 2 | 3 | import com.platform.productserver.entity.Merchant; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | /** 8 | *

9 | * 商户账户表 Mapper 接口 10 | *

11 | * 12 | * @author destiny 13 | * @since 2023-08-20 14 | */ 15 | public interface MerchantMapper extends BaseMapper { 16 | 17 | /** 18 | * 查询商户信息 19 | */ 20 | Merchant queryMerchantInfo(@Param("merchantNo") String merchantNo, @Param("accountType") Integer accountType); 21 | 22 | /** 23 | * 查询商户信息 读锁 24 | */ 25 | Merchant queryMerchantForUpdate(Long id); 26 | 27 | /** 28 | * 根据账户编号查询商户信息 29 | */ 30 | Merchant queryMerchantByNo(String accNo); 31 | } 32 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/mapper/PkgInLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.mapper; 2 | 3 | import com.platform.productserver.entity.PkgInLog; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | *

10 | * 红包领取记录表 Mapper 接口 11 | *

12 | * 13 | * @author destiny 14 | * @since 2023-08-16 15 | */ 16 | public interface PkgInLogMapper extends BaseMapper { 17 | 18 | /** 19 | * 查询红包领取记录 20 | */ 21 | List queryPkgInLogList(PkgInLog log); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/mapper/PkgOutLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.mapper; 2 | 3 | import com.platform.productserver.entity.PkgOutLog; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.platform.productserver.ext.PkgOutLogExt; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * 红包订单表 Mapper 接口 12 | *

13 | * 14 | * @author destiny 15 | * @since 2023-08-16 16 | */ 17 | public interface PkgOutLogMapper extends BaseMapper { 18 | 19 | PkgOutLog selectByOrderNo(String orderNo); 20 | 21 | /** 22 | * 查询超时的红包, 红包已过期 且 状态为成功的数据 23 | * @return 24 | */ 25 | List queryPkgOutTimeList(PkgOutLogExt ext); 26 | } 27 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/mapper/StockInfoMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.platform.productserver.entity.StockInfo; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @Description 10 | * @Date 2023-08-07 9:44 AM 11 | */ 12 | public interface StockInfoMapper extends BaseMapper { 13 | 14 | 15 | Integer saveStockInfo(StockInfo info); 16 | 17 | /** 18 | * 查询股票信息列表 19 | * @param info 20 | * @return 21 | */ 22 | List selectStockList(StockInfo info); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.mapper; 2 | 3 | import com.platform.productserver.entity.User; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

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

10 | * 11 | * @author destiny 12 | * @since 2023-08-20 13 | */ 14 | public interface UserMapper extends BaseMapper { 15 | 16 | /** 17 | * 根据 userid 查询用户信息 18 | */ 19 | User selectByUserId(String userId); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/order/OrderInfoDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.order; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.math.BigDecimal; 8 | 9 | /** 10 | * @Description 11 | * @Date 2023-09-07 8:26 PM 12 | */ 13 | @Data 14 | public class OrderInfoDto implements Serializable { 15 | 16 | private static final long serialVersionUID = -306584714990267992L; 17 | 18 | @ApiModelProperty(value = "用户id") 19 | private String userId; 20 | 21 | @ApiModelProperty(value = "交易金额") 22 | private BigDecimal amount; 23 | 24 | @ApiModelProperty(value = "订单号") 25 | private String orderNo; 26 | 27 | @ApiModelProperty(value = "商户号") 28 | private String merNo; 29 | 30 | public OrderInfoDto() { 31 | } 32 | 33 | public OrderInfoDto(String userId, BigDecimal amount, String orderNo) { 34 | this.userId = userId; 35 | this.amount = amount; 36 | this.orderNo = orderNo; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/order/OrderReq.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.order; 2 | 3 | 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | @Data 9 | public class OrderReq implements Serializable { 10 | 11 | private static final long serialVersionUID = 8943479354469323507L; 12 | 13 | 14 | 15 | 16 | } 17 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/redpkg/ReceivePkgReq.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.redpkg; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | @Data 8 | public class ReceivePkgReq implements Serializable { 9 | 10 | private static final long serialVersionUID = 4699754861708303761L; 11 | 12 | // 红包单号 13 | private String orderNo; 14 | // 红包请求号 15 | private String requestNo; 16 | // 领红包人id 红包类型 1-个人红包 2-群红包平分模式 2群红包拼手气 17 | private String receiverId; 18 | // 来源 19 | private String source; 20 | // 应用id 21 | private String appId; 22 | // 产品类型 23 | private String prodType; 24 | // 备注 25 | private String remark; 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/redpkg/RedPkgEnum.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.redpkg; 2 | 3 | import cn.hutool.core.util.StrUtil; 4 | 5 | /** 6 | * 红包类型枚举 7 | */ 8 | public enum RedPkgEnum { 9 | 10 | SINGLE("100", 1, "单个红包", "singleRedPkg"), 11 | GROUP_AVERAGE("101", 2, "群红包-平分模式", "groupRedPkg"), 12 | GROUP_RANDOM("101", 3, "群红包-拼手气模式", "groupRedPkg"); 13 | 14 | RedPkgEnum(String code, Integer type, String detail,String name) { 15 | this.code = code; 16 | this.type = type; 17 | this.detail = detail; 18 | this.name = name; 19 | } 20 | 21 | public String code; 22 | public Integer type; 23 | public String detail; 24 | public String name; 25 | 26 | 27 | public static RedPkgEnum queryPkgByType(Integer typ){ 28 | for (RedPkgEnum pkg : RedPkgEnum.values()){ 29 | if(pkg.type == typ){ 30 | return pkg; 31 | } 32 | } 33 | return null; 34 | } 35 | 36 | public static RedPkgEnum queryPkgByCode(String code){ 37 | for (RedPkgEnum pkg : RedPkgEnum.values()){ 38 | if(StrUtil.equals(pkg.code, code)){ 39 | return pkg; 40 | } 41 | } 42 | return null; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/redpkg/RedPkgNode.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.redpkg; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.math.BigDecimal; 7 | 8 | /** 9 | * 红包信息 10 | */ 11 | @Data 12 | public class RedPkgNode implements Serializable { 13 | 14 | private static final long serialVersionUID = -2331279787533960846L; 15 | // 红包单号 16 | private String orderNo; 17 | // 红包id 18 | private String id; 19 | // 红包金额 20 | private BigDecimal amount; 21 | 22 | public RedPkgNode() { 23 | } 24 | 25 | public RedPkgNode(String orderNo, String id, BigDecimal amount) { 26 | this.orderNo = orderNo; 27 | this.id = id; 28 | this.amount = amount; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/redpkg/RedPkgService.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.redpkg; 2 | 3 | /** 4 | * 红包方法和领取业务 5 | */ 6 | public interface RedPkgService { 7 | 8 | /** 9 | * 红包发送 10 | */ 11 | Boolean sendRedPkg(SendPkgReq pkgReq); 12 | 13 | /** 14 | * 红包领取 15 | */ 16 | Boolean receiveRedPkg(ReceivePkgReq pkgReq); 17 | } 18 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/redpkg/SendPkgReq.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.redpkg; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.math.BigDecimal; 7 | 8 | /** 9 | * 红包发送请求参数 10 | */ 11 | @Data 12 | public class SendPkgReq implements Serializable { 13 | 14 | private static final long serialVersionUID = -1823281196761885912L; 15 | 16 | // 红包单号 17 | private String orderNo; 18 | // 发送人ID 19 | private String senderId; 20 | // 红包总金额 21 | private BigDecimal total; 22 | // 红包总金额 23 | private Integer num; 24 | // 红包类型 1-个人红包 2-群红包平分模式 2群红包拼手气 25 | private Integer redType; 26 | 27 | // 来源 28 | private String source; 29 | // 应用id 30 | private String appId; 31 | // 产品类型 32 | private String prodType; 33 | // 备注 34 | private String remark; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/redpkg/impl/SingleRedPkg.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.redpkg.impl; 2 | 3 | import com.google.common.collect.Lists; 4 | import com.platform.authcommon.utils.IdGenUtils; 5 | import com.platform.productserver.redpkg.*; 6 | import lombok.extern.slf4j.Slf4j; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * 个人红包实现 13 | */ 14 | @Slf4j 15 | @Service(value = "singleRedPkg") 16 | public class SingleRedPkg extends AbstractRedPkgService implements RedPkgService { 17 | 18 | @Override 19 | public Boolean sendRedPkg(SendPkgReq pkgReq) { 20 | 21 | List nodeList = Lists.newArrayList(); 22 | String id = IdGenUtils.id(); 23 | RedPkgNode node = new RedPkgNode(); 24 | node.setAmount(pkgReq.getTotal()); 25 | node.setOrderNo(pkgReq.getOrderNo()); 26 | node.setId(id); 27 | // 存入缓存中 28 | saveRedPkg2Redis(pkgReq.getOrderNo(), nodeList); 29 | // 保存到数据库 30 | saveRedPkg2Db(pkgReq); 31 | return true; 32 | } 33 | 34 | @Override 35 | public Boolean receiveRedPkg(ReceivePkgReq pkgReq) { 36 | return super.receiveRedPkg(pkgReq); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/service/AccountService.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.service; 2 | 3 | import com.platform.productserver.dto.AccountDto; 4 | import com.platform.productserver.dto.BatchTradeResp; 5 | import com.platform.productserver.dto.TradeDto; 6 | import com.platform.productserver.entity.Account; 7 | import com.baomidou.mybatisplus.extension.service.IService; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | *

13 | * C端账户 服务 14 | *

15 | * 16 | * @author destiny 17 | * @since 2023-08-20 18 | */ 19 | public interface AccountService extends IService { 20 | 21 | 22 | /** 23 | * 账户开户 24 | */ 25 | boolean openAccount(AccountDto account); 26 | 27 | /** 28 | * 账户交易操作 29 | */ 30 | boolean trade(TradeDto tradeDto); 31 | 32 | /** 33 | * 批量交易接口 34 | */ 35 | BatchTradeResp tradeBatch(List dtoList); 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/service/GiveBatchInfoService.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.platform.productserver.entity.GiveBatchInfo; 5 | 6 | /** 7 | *

8 | * 积分分发信息表 服务类 9 | *

10 | * 11 | * @author destiny 12 | * @since 2023-09-11 13 | */ 14 | public interface GiveBatchInfoService extends IService { 15 | 16 | /** 17 | * 根据批次号查询批次信息 18 | * @param batchNo 19 | * @return 20 | */ 21 | GiveBatchInfo queryBatchInfo(String batchNo); 22 | 23 | 24 | Integer saveBatchInfo(GiveBatchInfo batchInfo); 25 | 26 | Integer updateBatchInfo(GiveBatchInfo batchInfo); 27 | 28 | 29 | Integer updateEntityById(GiveBatchInfo batchInf); 30 | } 31 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/service/GiveLogService.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.platform.productserver.entity.GiveLog; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | *

10 | * 积分分发订单表 服务类 11 | *

12 | * 13 | * @author destiny 14 | * @since 2023-09-11 15 | */ 16 | public interface GiveLogService extends IService { 17 | 18 | /** 19 | * 保存分发日志信息 20 | */ 21 | Integer insertGiveLogList(List logList); 22 | 23 | 24 | /** 25 | * 修改积分分发日志表 26 | */ 27 | Integer updateGiveLogList(List logs); 28 | 29 | 30 | GiveLog queryByGiveNo(String giveNo); 31 | 32 | List selectByBatchNo(String giveNo); 33 | } 34 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/service/GiveRefundLogService.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.platform.productserver.entity.GiveRefundLog; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | *

10 | * 发放撤回表 服务类 11 | *

12 | * 13 | * @author destiny 14 | * @since 2023-09-11 15 | */ 16 | public interface GiveRefundLogService extends IService { 17 | 18 | 19 | List queryByRefundNo(String giveNo); 20 | 21 | Integer insertEntity(GiveRefundLog insertLog); 22 | } 23 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/service/MerchantService.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.service; 2 | 3 | import com.platform.productserver.dto.*; 4 | import com.platform.productserver.entity.Merchant; 5 | import com.baomidou.mybatisplus.extension.service.IService; 6 | 7 | /** 8 | * B端账户表 服务类 9 | * @since 2023-08-20 10 | */ 11 | public interface MerchantService extends IService { 12 | 13 | /** 14 | * 账户开户 15 | */ 16 | boolean openAccount(MerchantDto account); 17 | /** 18 | * 账户交易 19 | */ 20 | boolean trade(BusinessDto trade); 21 | /** 22 | * 冻结操作 23 | */ 24 | boolean freeze(FreezeDto freezeDto); 25 | /** 26 | * 解冻操作 27 | */ 28 | boolean unFreeze(FreezeDto freezeDto); 29 | /** 30 | * 入账并冻结 31 | */ 32 | boolean freezeIn(FreezeTradeDto freezeDto); 33 | /** 34 | * 解冻并出账 35 | */ 36 | boolean unFreezeOut(FreezeTradeDto freezeDto); 37 | /** 38 | * 批量入账 39 | */ 40 | boolean batchTradeIn(BatchTradeDto tradeDto); 41 | /** 42 | * 批量出账 43 | */ 44 | boolean batchTradeOut(BatchTradeDto tradeDto); 45 | } 46 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/service/StockService.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.service; 2 | 3 | 4 | import com.platform.productserver.dto.FundDto; 5 | import com.platform.productserver.entity.EtfInfo; 6 | import com.platform.productserver.entity.StockInfo; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * @Description 12 | * @Date 2023-08-16 10:21 AM 13 | */ 14 | public interface StockService{ 15 | 16 | 17 | /** 18 | * 保存场外基金信息 19 | * @param funds 20 | * @return 21 | */ 22 | Integer saveFundInfoList(List funds); 23 | 24 | /** 25 | * 保存 etf 信息 26 | */ 27 | Integer saveEtfInfoList(List etfs); 28 | 29 | /** 30 | * 查询 ETF 列表信息 31 | * @return 32 | */ 33 | List queryEtfInfoList(); 34 | 35 | /** 36 | * 更新 etf 信息 37 | */ 38 | Integer updateEtfInfo(EtfInfo etfInfo); 39 | 40 | /** 41 | * 保存 stock 信息 42 | */ 43 | Integer saveStockInfoList(List list); 44 | } 45 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/service/TransLogService.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.service; 2 | 3 | import com.platform.productserver.entity.BtransLog; 4 | import com.platform.productserver.entity.CtransLog; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @Description 10 | * @Date 2023-09-18 3:27 PM 11 | */ 12 | public interface TransLogService { 13 | 14 | 15 | Integer insertCtransLogs(List logList); 16 | 17 | 18 | Integer insertBtransLogs(List logList); 19 | 20 | 21 | Integer updateCtransLog(CtransLog log); 22 | 23 | Integer updateBtransLog(BtransLog log); 24 | 25 | 26 | List queryBLogList(List idList); 27 | 28 | List queryCLogList(List idList); 29 | } 30 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.service; 2 | 3 | import com.platform.productserver.entity.User; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | /** 7 | *

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

10 | * 11 | * @author destiny 12 | * @since 2023-08-20 13 | */ 14 | public interface UserService extends IService { 15 | 16 | User selectByUserId(String userId); 17 | 18 | 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/service/impl/GiveRefundLogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.service.impl; 2 | 3 | 4 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 5 | import com.platform.productserver.entity.GiveRefundLog; 6 | import com.platform.productserver.mapper.GiveRefundLogMapper; 7 | import com.platform.productserver.service.GiveRefundLogService; 8 | import lombok.extern.slf4j.Slf4j; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | *

15 | * 发放撤回表 服务实现类 16 | *

17 | * 18 | * @author destiny 19 | * @since 2023-09-11 20 | */ 21 | @Slf4j 22 | @Service 23 | public class GiveRefundLogServiceImpl extends ServiceImpl implements GiveRefundLogService { 24 | 25 | 26 | @Override 27 | public List queryByRefundNo(String giveNo) { 28 | return baseMapper.selectByRefundNo(giveNo); 29 | } 30 | 31 | @Override 32 | public Integer insertEntity(GiveRefundLog insertLog) { 33 | return baseMapper.insert(insertLog); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/service/impl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.service.impl; 2 | 3 | import com.platform.productserver.entity.User; 4 | import com.platform.productserver.mapper.UserMapper; 5 | import com.platform.productserver.service.UserService; 6 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | *

11 | * 用户表 服务实现类 12 | *

13 | * 14 | * @author destiny 15 | * @since 2023-08-20 16 | */ 17 | @Service 18 | public class UserServiceImpl extends ServiceImpl implements UserService { 19 | 20 | 21 | @Override 22 | public User selectByUserId(String userId) { 23 | return baseMapper.selectByUserId(userId); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/stock/RefUtils.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.stock; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | 5 | /** 6 | * @Description 7 | * @Date 2023-08-24 3:34 PM 8 | */ 9 | @Slf4j 10 | public class RefUtils { 11 | 12 | public static void main(String[] args) { 13 | 14 | 15 | 16 | 17 | 18 | } 19 | 20 | 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/task/RedPkgTask.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.task; 2 | 3 | import com.platform.productserver.business.RedPkgBusiness; 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.scheduling.annotation.Scheduled; 7 | import org.springframework.stereotype.Component; 8 | 9 | /** 10 | * @Description 红包定时任务处理 11 | * @Date 2023-08-29 4:45 PM 12 | */ 13 | @Slf4j 14 | @Component 15 | public class RedPkgTask { 16 | 17 | 18 | @Autowired 19 | private RedPkgBusiness business; 20 | 21 | /** 22 | * 处理红包超时任务 23 | */ 24 | @Scheduled(cron = "30 1/2 * * * ?") 25 | public void task() { 26 | log.info("红包超时定时任务处理"); 27 | business.handleRedPkgOverTime(); 28 | } 29 | 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/utils/ExCatchUtils.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.utils; 2 | 3 | import com.platform.authcommon.exception.AppException; 4 | import lombok.extern.slf4j.Slf4j; 5 | 6 | import java.lang.reflect.Method; 7 | import java.util.regex.Pattern; 8 | 9 | /** 10 | * @Description 异常处理器 11 | * @Date 2023-10-11 3:56 PM 12 | */ 13 | 14 | @Slf4j 15 | public class ExCatchUtils { 16 | 17 | 18 | public static void doCatch(Exception ex, String msg) { 19 | 20 | if (ex instanceof AppException) { 21 | log.error("error is {}", ((AppException) ex).getMsg(), ex); 22 | } else { 23 | log.error("error is {}", ex.getMessage(), ex); 24 | } 25 | 26 | 27 | } 28 | 29 | 30 | } 31 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/utils/LocalCacheBuilder.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.utils; 2 | 3 | import com.google.common.cache.Cache; 4 | import com.google.common.cache.CacheBuilder; 5 | import lombok.extern.slf4j.Slf4j; 6 | 7 | import java.util.concurrent.TimeUnit; 8 | 9 | /** 10 | * @Description 11 | * @Date 2023-08-16 12:58 PM 12 | */ 13 | @Slf4j 14 | public class LocalCacheBuilder { 15 | 16 | /** 17 | * 初始化 Cache Builder 18 | * 初始化数据容量 19 | * 最大容量 20 | * 并发度 21 | * 写入后多久过期 22 | */ 23 | public static final Cache localCache = CacheBuilder.newBuilder() 24 | .initialCapacity(100) 25 | .maximumSize(10000) 26 | .concurrencyLevel(3) 27 | .expireAfterWrite(10, TimeUnit.SECONDS) 28 | .build(); 29 | 30 | 31 | public static void main(String[] args) { 32 | 33 | LocalCacheBuilder.localCache.put("234", "456"); 34 | String value = LocalCacheBuilder.localCache.getIfPresent("345"); 35 | System.out.println(value); 36 | 37 | 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/utils/LruCache.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.utils; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.LinkedHashMap; 6 | import java.util.Map; 7 | 8 | /** 9 | * @Description 10 | * @Date 2023-09-07 10:17 PM 11 | */ 12 | 13 | @Data 14 | public class LruCache extends LinkedHashMap { 15 | 16 | /** 17 | * 缓存允许的最大容量 18 | */ 19 | private final int maxSize; 20 | 21 | public LruCache(int initialCapacity, int maxSize) { 22 | // accessOrder必须为true 23 | super(initialCapacity, 0.75f, true); 24 | this.maxSize = maxSize; 25 | } 26 | 27 | @Override 28 | protected boolean removeEldestEntry(Map.Entry eldest) { 29 | // 当键值对个数超过最大容量时,返回true,触发删除操作 30 | return size() > maxSize; 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/utils/OrderCalNode.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.utils; 2 | 3 | import cn.hutool.core.util.NumberUtil; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.math.BigDecimal; 8 | 9 | /** 10 | * 订单子单计算对象 11 | */ 12 | @Data 13 | public class OrderCalNode implements Serializable { 14 | 15 | private static final long serialVersionUID = -4305779956803150142L; 16 | 17 | // 订单id 18 | private String keyId; 19 | // 子单总金额 20 | private BigDecimal total; 21 | // 积分金额 22 | private BigDecimal point; 23 | // 积分实付 24 | private BigDecimal pointAct; 25 | // 现金金额 26 | private BigDecimal cash; 27 | // 膨胀金 28 | private BigDecimal expand; 29 | // 立减金额 30 | private BigDecimal inflation; 31 | 32 | // 计算现金和积分总金额 33 | public void calculateCashPoint() { 34 | this.cash = NumberUtil.sub(total, pointAct, expand, inflation); 35 | this.point = NumberUtil.add(pointAct, expand, inflation); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/utils/RedPkgUtils.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.utils; 2 | 3 | /** 4 | * 红包 5 | */ 6 | public class RedPkgUtils { 7 | 8 | 9 | 10 | } 11 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/web/OrderController.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.web; 2 | 3 | 4 | import cn.hutool.core.date.DateTime; 5 | import cn.hutool.core.date.DateUtil; 6 | import com.platform.authcommon.common.Result; 7 | import com.platform.productserver.order.OrderReq; 8 | import io.swagger.annotations.ApiOperation; 9 | import lombok.extern.slf4j.Slf4j; 10 | import org.springframework.web.bind.annotation.PostMapping; 11 | import org.springframework.web.bind.annotation.RequestBody; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RestController; 14 | 15 | /** 16 | * 订单服务 17 | */ 18 | @Slf4j 19 | @RestController 20 | @RequestMapping(value = "api/order") 21 | public class OrderController { 22 | 23 | 24 | @ApiOperation("订单创建") 25 | @PostMapping(value = "create") 26 | public Result createOrder(@RequestBody OrderReq orderReq){ 27 | 28 | DateTime parse = DateUtil.parse("2024-01-01 03:00", "yyyy-MM-dd HH:mm"); 29 | 30 | 31 | return Result.success(true); 32 | } 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/web/PayController.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.web; 2 | 3 | 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | * 支付 10 | */ 11 | @Slf4j 12 | @RestController 13 | @RequestMapping(value = "api/pay") 14 | public class PayController { 15 | 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /product-server/src/main/java/com/platform/productserver/web/SettleController.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver.web; 2 | 3 | 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | @Slf4j 9 | @RestController 10 | @RequestMapping(value = "api/settle") 11 | public class SettleController { 12 | 13 | 14 | 15 | 16 | } 17 | -------------------------------------------------------------------------------- /product-server/src/main/resources/application-dev.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedestiny/springboot-auth/72f7f52f02ddbd42bdba6678d784651084484894/product-server/src/main/resources/application-dev.yml -------------------------------------------------------------------------------- /product-server/src/main/resources/bootstrap.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | profiles: 3 | active: dev 4 | application: 5 | name: product-server 6 | main: 7 | allow-bean-definition-overriding: true 8 | 9 | cloud: 10 | config: 11 | allow-override: true 12 | nacos: 13 | config: 14 | group: springboot-oauth 15 | server-addr: localhost:8848 16 | namespace: 163c702f-c805-42f2-a1e1-a491f086f3a2 17 | # file-extension: properties 18 | username: nacos 19 | password: nacos 20 | encode: UTF-8 21 | max-retry: 3 22 | timeout: 4000 23 | refresh-enabled: true -------------------------------------------------------------------------------- /product-server/src/main/resources/mapper/FreezeMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | id, account_id, freeze_type, freeze_amount, create_time, update_time 19 | 20 | 21 | 22 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /product-server/src/main/resources/mapper/MenuMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | id, `name`, seq, parent_id, create_time, update_time 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /product-server/src/main/resources/tpl/service.java.ftl: -------------------------------------------------------------------------------- 1 | package ${package.Service}; 2 | 3 | import ${package.Entity}.${entity}; 4 | 5 | /** 6 | * ${table.comment!} 服务类 7 | * @author ${author} 8 | * @since ${date} 9 | */ 10 | <#if kotlin> 11 | interface ${table.serviceName} : ${superServiceClass}<${entity}> 12 | <#else> 13 | public interface ${table.serviceName} { 14 | 15 | /** 16 | 新增数据 17 | */ 18 | Integer insert(${entity} entity); 19 | 20 | /** 21 | 更新数据 22 | */ 23 | Integer updateById(${entity} entity); 24 | /** 25 | 查询单条数据 26 | */ 27 | ${entity} queryById(Long id); 28 | 29 | 30 | 31 | 32 | } 33 | 34 | -------------------------------------------------------------------------------- /product-server/src/test/java/com/platform/productserver/AppEngine.java: -------------------------------------------------------------------------------- 1 | package com.platform.productserver; 2 | 3 | import com.baomidou.mybatisplus.generator.config.GlobalConfig; 4 | import com.baomidou.mybatisplus.generator.config.po.TableInfo; 5 | import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine; 6 | import lombok.Data; 7 | import lombok.experimental.Accessors; 8 | 9 | import java.util.Map; 10 | 11 | /** 12 | * 模板生成器,用于添加全局变量 13 | * @Description 14 | * @Author kaiyang 15 | * @Date 2023-12-19 5:26 下午 16 | */ 17 | 18 | @Data 19 | public class AppEngine extends FreemarkerTemplateEngine { 20 | 21 | private Map parameters; 22 | 23 | @Override 24 | public Map getObjectMap(TableInfo tableInfo) { 25 | Map objectMap = super.getObjectMap(tableInfo); 26 | for(Map.Entry entry : parameters.entrySet()){ 27 | objectMap.put(entry.getKey(), entry.getValue()); 28 | } 29 | return objectMap; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /product-server/xueqiu.md: -------------------------------------------------------------------------------- 1 | 2 | ``` 3 | 4 | # 股票列表 5 | https://stock.xueqiu.com/v5/stock/screener/quote/list.json?page=1&size=30&order=desc&orderby=code&order_by=symbol&market=CN&type=sh_sz 6 | 7 | # k线图 8 | https://stock.xueqiu.com/v5/stock/chart/kline.json?symbol=SH601919&begin=1691395144420&period=month&type=after&count=-190&indicator=kline,pe,pb,ps,pcf,market_capital,agt,ggt,balance 9 | 10 | # lsm tree 11 | https://blog.csdn.net/qq_47159522/article/details/126751195 12 | https://zhuanlan.zhihu.com/p/181498475 13 | https://baijiahao.baidu.com/s?id=1720017754384417208&wfr=spider&for=pc 14 | 15 | 002019 16 | 17 | 18 | select `code`, `name`, `week`, `month`, `month3`, `half`, `year`, `since`, `fund_type`, issue, baseline, tracking, fund_size from tb_fund_info where since > 2 and since < 5 and `name` like "%C" and month > -0.01 and week > -0.01 and month3 > -0.01 19 | 20 | 0-入账;1-出账;2-冲正;3-销毁;4-增加结算能力;5-减少结算能力; 21 | 6-增加手续费;7-减少手续费; 22 | 8-分发;9-分发撤回出账;10-分发撤回入账; 23 | 11-离职转账出;12-离职转账入 24 | 25 | 26 | ``` 27 | -------------------------------------------------------------------------------- /sandbox-desen/src/main/java/com/platform/desen/config/MaskAutoConfig.java: -------------------------------------------------------------------------------- 1 | package com.platform.desen.config; 2 | 3 | import org.springframework.context.annotation.ComponentScan; 4 | 5 | /** 6 | * @Description 7 | * @Author kaiyang 8 | * @Date 2024-02-22 6:52 PM 9 | */ 10 | 11 | @ComponentScan("com.platform.desen") 12 | public class MaskAutoConfig { 13 | 14 | 15 | 16 | } 17 | -------------------------------------------------------------------------------- /sandbox-desen/src/main/java/com/platform/desen/config/MaskConfig.java: -------------------------------------------------------------------------------- 1 | package com.platform.desen.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | import java.io.Serializable; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | /** 脱敏配置 12 | * @Description 13 | * @Author kaiyang 14 | * @Date 2024-02-22 6:44 PM 15 | */ 16 | @Data 17 | @Configuration(value = "maskConfig") 18 | public class MaskConfig implements Serializable { 19 | 20 | private static final long serialVersionUID = -746315412160267803L; 21 | // 是否开启脱敏 22 | @Value("${log.mask.enable:true}") 23 | private Boolean enable; 24 | // 日志路径 25 | @Value("${log.mask.path:com.platform}") 26 | private String path; 27 | // 关键字规则 28 | @Value("${log.mask.keyword:true}") 29 | private Boolean keyword = true; 30 | // 正则表达式 31 | @Value("${log.mask.regrex:true}") 32 | private Boolean regrex = true; 33 | // 关键字脱敏 34 | @Value("#{${log.mask.keywordMap}}") 35 | private Map> keywordMap; 36 | // 正则表达规则 37 | @Value("#{${log.mask.regrexMap}}") 38 | private Map regrexMap; 39 | 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /sandbox-desen/src/main/java/com/platform/desen/config/MaskRuleEnum.java: -------------------------------------------------------------------------------- 1 | package com.platform.desen.config; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | * @Description 脱敏规则以及处理器 8 | * @Author kaiyang 9 | * @Date 2024-02-23 4:57 PM 10 | */ 11 | public enum MaskRuleEnum { 12 | 13 | PHONE("phone", "phoneHandler"), 14 | NAME("name", "nameHandler"), 15 | EMAIL("email", "emailHandler"), 16 | ID_CARD("idCard", "idCardHandler"), 17 | ADDRESS("address", "addressHandler"), 18 | BANK("bank", "bankHandler"), 19 | ; 20 | 21 | MaskRuleEnum(String rule, String handler) { 22 | this.rule = rule; 23 | this.handler = handler; 24 | } 25 | 26 | public String rule; 27 | public String handler; 28 | 29 | public final static Map map = new HashMap(); 30 | 31 | static { 32 | for (MaskRuleEnum rule : MaskRuleEnum.values()) { 33 | map.put(rule.rule, rule.handler); 34 | } 35 | } 36 | public static String match(String name) { 37 | return map.get(name); 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /sandbox-desen/src/main/java/com/platform/desen/config/SpFactUtils.java: -------------------------------------------------------------------------------- 1 | package com.platform.desen.config; 2 | 3 | 4 | import org.springframework.beans.BeansException; 5 | import org.springframework.context.ApplicationContext; 6 | import org.springframework.context.ApplicationContextAware; 7 | import org.springframework.stereotype.Component; 8 | 9 | 10 | @Component 11 | public class SpFactUtils implements ApplicationContextAware { 12 | 13 | private static ApplicationContext ctx; 14 | 15 | 16 | @Override 17 | public void setApplicationContext(ApplicationContext context) throws BeansException { 18 | SpFactUtils.ctx = context; 19 | } 20 | 21 | public static T getBean(Class clazz) { 22 | return ctx.getBean(clazz); 23 | } 24 | 25 | public static T getBean(String name, Class clazz) { 26 | return ctx.getBean(name, clazz); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /sandbox-desen/src/main/java/com/platform/desen/convert/ModuleConverter.java: -------------------------------------------------------------------------------- 1 | package com.platform.desen.convert; 2 | 3 | import ch.qos.logback.classic.pattern.ClassicConverter; 4 | import ch.qos.logback.classic.spi.ILoggingEvent; 5 | import cn.hutool.core.net.NetUtil; 6 | 7 | /** 8 | * @Description 9 | * @Author kaiyang 10 | * @Date 2024-02-23 9:12 AM 11 | */ 12 | public class ModuleConverter extends ClassicConverter { 13 | 14 | public String convert(ILoggingEvent event) { 15 | return event.getLoggerName().length() > 20 ? "" : event.getLoggerName(); 16 | } 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /sandbox-desen/src/main/java/com/platform/desen/convert/NetAddressConverter.java: -------------------------------------------------------------------------------- 1 | package com.platform.desen.convert; 2 | 3 | import ch.qos.logback.classic.pattern.ClassicConverter; 4 | import ch.qos.logback.classic.spi.ILoggingEvent; 5 | import cn.hutool.core.net.NetUtil; 6 | 7 | /** 8 | * @Description 9 | * @Author kaiyang 10 | * @Date 2024-02-23 9:12 AM 11 | */ 12 | public class NetAddressConverter extends ClassicConverter { 13 | 14 | public String convert(ILoggingEvent event) { 15 | String address = NetUtil.getLocalhost().getHostAddress(); 16 | return address; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /sandbox-desen/src/main/java/com/platform/desen/handler/AddressHandler.java: -------------------------------------------------------------------------------- 1 | package com.platform.desen.handler; 2 | 3 | import cn.hutool.core.util.DesensitizedUtil; 4 | import org.springframework.stereotype.Component; 5 | 6 | import java.util.regex.Pattern; 7 | 8 | /** 9 | * @Description 10 | * @Author kaiyang 11 | * @Date 2024-02-23 4:23 PM 12 | */ 13 | 14 | @Component 15 | public class AddressHandler extends AbstractMaskHandler implements MaskHandler { 16 | 17 | private static final Pattern PATTERN = Pattern.compile("\\d+"); 18 | 19 | 20 | public int getStartIdx(String matcherGroupStr) { 21 | return 0; 22 | } 23 | 24 | public int getEndIdx(String matcherGroupStr) { 25 | return 0; 26 | } 27 | 28 | public String regrex(String str) { 29 | return str; 30 | } 31 | 32 | 33 | public String keyword(String str) { 34 | return DesensitizedUtil.address(str, str.length() / 2); 35 | } 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /sandbox-desen/src/main/java/com/platform/desen/handler/BankHandler.java: -------------------------------------------------------------------------------- 1 | package com.platform.desen.handler; 2 | 3 | import cn.hutool.core.util.DesensitizedUtil; 4 | import org.springframework.stereotype.Component; 5 | 6 | import java.util.regex.Pattern; 7 | 8 | /** 9 | * @Description 10 | * @Author kaiyang 11 | * @Date 2024-02-23 4:23 PM 12 | */ 13 | 14 | @Component 15 | public class BankHandler extends AbstractMaskHandler implements MaskHandler { 16 | 17 | private static final Pattern PATTERN = Pattern.compile("(? 7 ? this.lastReplace(s, 3, 3) : "*****"; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /sandbox-desen/src/main/java/com/platform/desen/handler/MaskHandler.java: -------------------------------------------------------------------------------- 1 | package com.platform.desen.handler; 2 | 3 | /** 4 | * @Description 5 | * @Author kaiyang 6 | * @Date 2024-02-23 10:03 AM 7 | */ 8 | public interface MaskHandler { 9 | 10 | // 正则匹配方式 11 | String regrex(String str); 12 | 13 | 14 | // 关键字匹配方式 15 | String keyword(String str); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /sandbox-desen/src/main/java/com/platform/desen/handler/NameHandler.java: -------------------------------------------------------------------------------- 1 | package com.platform.desen.handler; 2 | 3 | import cn.hutool.core.util.DesensitizedUtil; 4 | import org.springframework.stereotype.Component; 5 | 6 | import java.util.regex.Pattern; 7 | 8 | /** 9 | * @Description 10 | * @Author kaiyang 11 | * @Date 2024-02-23 4:23 PM 12 | */ 13 | 14 | @Component 15 | public class NameHandler extends AbstractMaskHandler implements MaskHandler { 16 | 17 | private static final Pattern PATTERN = Pattern.compile("(? { 16 | 17 | 18 | List queryStudentPageList(StudentReq studentReq); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /sandbox-flex/src/main/java/com/platform/flex/mq/AppMessageListener.java: -------------------------------------------------------------------------------- 1 | package com.platform.flex.mq; 2 | 3 | 4 | import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; 5 | import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; 6 | import org.apache.rocketmq.client.consumer.listener.MessageListener; 7 | import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; 8 | import org.apache.rocketmq.common.message.MessageExt; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * 14 | * messageDelayLevel=1s 5s 10s 30s 1m 2m 3m 4m 5m 6m 7m 8m 9m 10m 20m 30m 1h 2h 15 | * 16 | * 消息消费 17 | * @Description 18 | * @Date 2023-12-02 11:34 PM 19 | */ 20 | public class AppMessageListener implements MessageListenerConcurrently { 21 | 22 | 23 | @Override 24 | public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) { 25 | 26 | 27 | // return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; 28 | return ConsumeConcurrentlyStatus.RECONSUME_LATER; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /sandbox-flex/src/main/java/com/platform/flex/mq/AppMsgFilterListener.java: -------------------------------------------------------------------------------- 1 | package com.platform.flex.mq; 2 | 3 | // import org.apache.rocketmq.client.consumer.listener.MessageListener; 4 | 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.apache.rocketmq.spring.annotation.MessageModel; 7 | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; 8 | import org.apache.rocketmq.spring.annotation.SelectorType; 9 | import org.apache.rocketmq.spring.core.RocketMQListener; 10 | 11 | /** 12 | * https://blog.csdn.net/m0_49183244/article/details/129169326 13 | * https://blog.csdn.net/m0_49183244/article/details/128147349 14 | * https://blog.csdn.net/weixin_41953346/article/details/127324629 15 | * 16 | * 17 | */ 18 | 19 | /** 20 | * 默认为集群消息,广播消息所有的消费者都能收到,一般用于配置的广播 21 | */ 22 | @Slf4j 23 | @RocketMQMessageListener( 24 | consumerGroup = "springboot_consumer_group", 25 | topic="app-auth-filter", 26 | selectorType = SelectorType.SQL92, 27 | selectorExpression = "a between 6 and 9", 28 | messageModel = MessageModel.CLUSTERING 29 | ) 30 | public class AppMsgFilterListener implements RocketMQListener { 31 | 32 | @Override 33 | public void onMessage(String message) { 34 | log.info("message {} ", message); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /sandbox-flex/src/main/java/com/platform/flex/mq/AppMsgListener.java: -------------------------------------------------------------------------------- 1 | package com.platform.flex.mq; 2 | 3 | 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.apache.rocketmq.spring.annotation.MessageModel; 6 | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; 7 | import org.apache.rocketmq.spring.core.RocketMQListener; 8 | import org.springframework.stereotype.Component; 9 | 10 | /** 11 | * https://blog.csdn.net/m0_49183244/article/details/129169326 12 | * 13 | * https://blog.csdn.net/weixin_41953346/article/details/127324629 14 | * 15 | * 16 | */ 17 | 18 | /** 19 | * 默认为集群消息,广播消息所有的消费者都能收到,一般用于配置的广播 20 | */ 21 | @Slf4j 22 | @Component 23 | @RocketMQMessageListener( 24 | consumerGroup = "springboot_consumer_group", 25 | topic="order-notice", 26 | selectorExpression = "*", 27 | messageModel = MessageModel.CLUSTERING 28 | ) 29 | public class AppMsgListener implements RocketMQListener { 30 | 31 | @Override 32 | public void onMessage(String message) { 33 | log.info("message {} ", message); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /sandbox-flex/src/main/java/com/platform/flex/mq/AppMsgTxListener.java: -------------------------------------------------------------------------------- 1 | package com.platform.flex.mq; 2 | 3 | 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.apache.rocketmq.spring.annotation.MessageModel; 6 | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; 7 | import org.apache.rocketmq.spring.core.RocketMQListener; 8 | import org.springframework.stereotype.Component; 9 | 10 | 11 | /** 12 | * 消费事务消息 13 | */ 14 | @Slf4j 15 | @Component 16 | @RocketMQMessageListener( 17 | consumerGroup = "springboot_consumer_group", 18 | topic="tx-message", 19 | selectorExpression = "*", 20 | messageModel = MessageModel.CLUSTERING 21 | ) 22 | public class AppMsgTxListener implements RocketMQListener { 23 | 24 | @Override 25 | public void onMessage(String message) { 26 | 27 | log.info("tx message {} ", message); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sandbox-flex/src/main/java/com/platform/flex/service/StudentService.java: -------------------------------------------------------------------------------- 1 | package com.platform.flex.service; 2 | 3 | import com.mybatisflex.core.service.IService; 4 | import com.platform.flex.entity.Student; 5 | 6 | /** 7 | * @Description 8 | * @Date 2023-11-14 2:34 PM 9 | */ 10 | public interface StudentService extends IService { 11 | 12 | 13 | 14 | Student queryEntityById(Long id); 15 | 16 | 17 | } 18 | -------------------------------------------------------------------------------- /sandbox-flex/src/main/java/com/platform/flex/utils/AppUtils.java: -------------------------------------------------------------------------------- 1 | package com.platform.flex.utils; 2 | 3 | /** 4 | * @Description 5 | * @Date 2023-11-15 2:38 PM 6 | */ 7 | public class AppUtils { 8 | 9 | private String name; 10 | private Integer age; 11 | 12 | public String getName() { 13 | return name; 14 | } 15 | 16 | public void setName(String name) { 17 | this.name = name; 18 | } 19 | 20 | public Integer getAge() { 21 | return age; 22 | } 23 | 24 | public void setAge(Integer age) { 25 | this.age = age; 26 | } 27 | 28 | private AppUtils() { 29 | } 30 | 31 | public static AppUtils newApp(String name, Integer age){ 32 | 33 | AppUtils appUtils = new AppUtils(); 34 | appUtils.setAge(age); 35 | appUtils.setName(name); 36 | 37 | return appUtils; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /sandbox-flex/src/main/java/com/platform/flex/utils/IdGenutils.java: -------------------------------------------------------------------------------- 1 | package com.platform.flex.utils; 2 | 3 | import cn.hutool.core.lang.Snowflake; 4 | 5 | /** 6 | * @Description 7 | * @Date 2023-12-01 2:54 PM 8 | */ 9 | public class IdGenutils { 10 | 11 | 12 | 13 | private static final Snowflake flake; 14 | 15 | 16 | static { 17 | flake = new Snowflake(); 18 | } 19 | 20 | 21 | public static String idStr(){ 22 | return flake.nextIdStr(); 23 | } 24 | 25 | public static Long id(){ 26 | return flake.nextId(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /sandbox-flex/src/main/java/com/platform/flex/utils/TestStastic.java: -------------------------------------------------------------------------------- 1 | package com.platform.flex.utils; 2 | 3 | import com.platform.flex.entity.Student; 4 | 5 | /** 6 | * @Description 7 | * @Date 2023-11-15 2:37 PM 8 | */ 9 | public class TestStastic { 10 | 11 | 12 | public void test(Student student) { 13 | 14 | // AppUtils.newApp(student.getUsername(), student.getAge()); 15 | // 16 | // System.out.println("ss"); 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /sandbox-flex/src/main/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | # https://mp.weixin.qq.com/s/iRCP6hEiKOLEp8QRm_OsWQ 2 | # Message message = new Message(); 3 | # message.setDelayTimeLevel(1); 4 | 5 | -------------------------------------------------------------------------------- /sandbox-flex/src/test/java/com/platform/flex/MockTest.java: -------------------------------------------------------------------------------- 1 | package com.platform.flex; 2 | 3 | import com.platform.flex.entity.Student; 4 | import com.platform.flex.utils.TestStastic; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.junit.jupiter.api.Test; 7 | 8 | /** 9 | * @Description 10 | * @Author kaiyang 11 | * @Date 2023-11-15 2:36 PM 12 | */ 13 | 14 | @Slf4j 15 | public class MockTest { 16 | 17 | 18 | @Test 19 | public void test01() { 20 | 21 | log.info("start test !"); 22 | 23 | TestStastic sta = new TestStastic(); 24 | 25 | Student student = new Student(); 26 | sta.test(student); 27 | 28 | 29 | } 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /sandbox-message/src/hold.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedestiny/springboot-auth/72f7f52f02ddbd42bdba6678d784651084484894/sandbox-message/src/hold.md -------------------------------------------------------------------------------- /sandbox-message/src/main/java/com/platform/messsage/BootApplication.java: -------------------------------------------------------------------------------- 1 | package com.platform.messsage; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | /** 8 | * @Description 消息启动类 9 | * @Date 2023-12-08 11:04 AM 10 | */ 11 | 12 | @Slf4j 13 | @SpringBootApplication 14 | public class BootApplication { 15 | 16 | 17 | public static void main(String[] args) { 18 | 19 | log.info("start product boot message ! "); 20 | SpringApplication.run(BootApplication.class, args); 21 | 22 | 23 | } 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /sandbox-message/src/main/java/com/platform/messsage/common/AppConstant.java: -------------------------------------------------------------------------------- 1 | package com.platform.messsage.common; 2 | 3 | public class AppConstant { 4 | 5 | 6 | /** 7 | * direct 模式 8 | */ 9 | public static final String DIRECT_EXCHANGE = "direct_exchange"; 10 | public static final String DIRECT_ROUTE_KEY = "direct_route_key"; 11 | public static final String DIRECT_QUEUE = "direct_queue"; 12 | 13 | /** 14 | * topic 模式 15 | */ 16 | public static final String TOPIC_EXCHANGE = "topic_exchange"; 17 | public static final String TOPIC_QUEUE_PHONE = "topic.queue.phone"; 18 | public static final String TOPIC_QUEUE_MALL = "topic.queue.mall"; 19 | public static final String TOPIC_QUEUE_ALL = "topic.queue.#"; 20 | 21 | /** 22 | * fanout 模式 23 | */ 24 | public static final String FANOUT_EXCHANGE = "fanout_exchange"; 25 | public static final String FANOUT_QUEUE_A = "fanout_queue_a"; 26 | public static final String FANOUT_QUEUE_B = "fanout_queue_b"; 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /sandbox-message/src/main/java/com/platform/messsage/dto/MsgDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.messsage.dto; 2 | 3 | 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | @Data 9 | public class MsgDto implements Serializable { 10 | 11 | private static final long serialVersionUID = 1662899537386034320L; 12 | 13 | private String code; 14 | 15 | private String message; 16 | 17 | private String date; 18 | 19 | private String data; 20 | 21 | 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /sandbox-message/src/main/java/com/platform/messsage/listener/MqReceiver.java: -------------------------------------------------------------------------------- 1 | package com.platform.messsage.listener; 2 | 3 | import com.rabbitmq.client.Channel; 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.springframework.amqp.core.Message; 6 | import org.springframework.amqp.rabbit.listener.api.ChannelAwareMessageListener; 7 | import org.springframework.stereotype.Component; 8 | 9 | /** 10 | * @Description 11 | * @Date 2023-12-08 4:39 PM 12 | */ 13 | 14 | @Slf4j 15 | @Component 16 | public class MqReceiver implements ChannelAwareMessageListener { 17 | 18 | 19 | @Override 20 | public void onMessage(Message message, Channel channel) throws Exception { 21 | long deliveryTag = message.getMessageProperties().getDeliveryTag(); 22 | String queue = message.getMessageProperties().getConsumerQueue(); 23 | log.info("queue {} tag {} msg {}", queue, deliveryTag, new String(message.getBody())); 24 | } 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /sandbox-message/src/main/java/com/platform/messsage/utils/OrderNoUtils.java: -------------------------------------------------------------------------------- 1 | package com.platform.messsage.utils; 2 | 3 | import cn.hutool.core.lang.Snowflake; 4 | 5 | /** 6 | * 7 | * @Description 订单号生成器 8 | * @Date 2023-12-11 10:51 上午 9 | */ 10 | 11 | public class OrderNoUtils { 12 | 13 | 14 | private static Snowflake flake; 15 | 16 | static { 17 | flake = new Snowflake(); 18 | } 19 | 20 | 21 | public static String idStr(){ 22 | return flake.nextIdStr(); 23 | } 24 | 25 | public static Long id(){ 26 | return flake.nextId(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /sandbox-message/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: boot-rabbitmq 4 | profiles: 5 | active: dev 6 | rabbitmq: 7 | # addresses: localhost http://192.168.0.102:15674 http://192.168.0.102:15672 guest/guest 8 | addresses: localhost:5678 9 | # port: 5672 10 | # host: 192.168.0.102 11 | # port: 5678 12 | username: guest 13 | password: guest 14 | virtual-host: bootapp 15 | # 确认消息已经发送到交换机 exchange 16 | # publisher-confirms: true 17 | # 确认消息已经发送到队列 queue 18 | # publisher-returns: true 19 | publisher-confirm-type: correlated 20 | publisher-returns: true 21 | template: 22 | retry: 23 | initial-interval: 1000ms 24 | enabled: true 25 | multiplier: 3 26 | max-attempts: 5 27 | max-interval: 3000ms 28 | 29 | 30 | -------------------------------------------------------------------------------- /sandbox-practice/src/main/java/com/platform/practice/SandboxPracticeApplication.java: -------------------------------------------------------------------------------- 1 | package com.platform.practice; 2 | 3 | import cn.hutool.core.date.DateUtil; 4 | import cn.hutool.core.date.TimeInterval; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.boot.SpringApplication; 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | 9 | 10 | @Slf4j 11 | @SpringBootApplication 12 | public class SandboxPracticeApplication { 13 | 14 | public static void main(String[] args) { 15 | 16 | TimeInterval timer = DateUtil.timer(); 17 | SpringApplication.run(SandboxPracticeApplication.class, args); 18 | log.info("start practice cost time {} ms", timer.intervalMs()); 19 | 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /sandbox-practice/src/main/java/com/platform/practice/dto/Result.java: -------------------------------------------------------------------------------- 1 | package com.platform.practice.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @Description 9 | * @Author kaiyang 10 | * @Date 2024-01-25 10:51 AM 11 | */ 12 | 13 | @Data 14 | public class Result implements Serializable { 15 | 16 | 17 | private static final long serialVersionUID = 1268337253895534051L; 18 | private Integer code; 19 | 20 | private String msg; 21 | 22 | private T data; 23 | 24 | public static Result success() { 25 | Result result = new Result<>(); 26 | result.setCode(200); 27 | result.setMsg("成功"); 28 | return result; 29 | } 30 | 31 | public static Result success(T data) { 32 | Result result = new Result<>(); 33 | result.setCode(200); 34 | result.setMsg("成功"); 35 | result.setData(data); 36 | return result; 37 | } 38 | 39 | public static Result failure(String msg) { 40 | Result result = new Result<>(); 41 | result.setCode(200); 42 | result.setMsg(msg); 43 | return result; 44 | } 45 | 46 | public static Result failure() { 47 | return failure("失败"); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /sandbox-practice/src/main/java/com/platform/practice/web/IndexController.java: -------------------------------------------------------------------------------- 1 | package com.platform.practice.web; 2 | 3 | 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | 10 | /** 11 | * @Description 12 | * @Author liangkaiyang 13 | * @Date 2024-12-23 11:10 AM 14 | */ 15 | 16 | @Slf4j 17 | @RestController 18 | public class IndexController { 19 | 20 | @GetMapping(value = "/test/list") 21 | public String test(HttpServletRequest request){ 22 | log.info("test {}", request.getRequestURI()); 23 | return ""; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /sandbox-practice/src/main/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | 2 | spring: 3 | datasource: 4 | dynamic: 5 | primary: datasource1 #设置默认的数据源或者数据源组,默认值即为datasource1 6 | strict: false #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源 7 | datasource: 8 | datasource1: 9 | url: jdbc:mysql://127.0.0.1:33060/datasource1?characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false 10 | username: root 11 | password: root 12 | driver-class-name: com.mysql.cj.jdbc.Driver 13 | datasource2: 14 | url: jdbc:mysql://127.0.0.1:33060/datasource2?characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false 15 | username: root 16 | password: root 17 | driver-class-name: com.mysql.cj.jdbc.Driver 18 | -------------------------------------------------------------------------------- /sandbox-practice/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | app.service.uri= {"/test/list": "/service-name","/test/list1": "/service-name"} 3 | app.service.server=test.com 4 | -------------------------------------------------------------------------------- /sandbox-practice/src/main/resources/application.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedestiny/springboot-auth/72f7f52f02ddbd42bdba6678d784651084484894/sandbox-practice/src/main/resources/application.yml -------------------------------------------------------------------------------- /sandbox-practice/src/test/java/com/platform/practice/SandboxPracticeApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.platform.practice; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SandboxPracticeApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /sandbox-stock/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ```sql 4 | 5 | 6 | 7 | select code,brief, price, rate,week,update_date,`month`, `year`, fund_size,detail from tb_etf_info order by detail desc , fund_size desc 8 | 9 | ``` 10 | 11 | 12 | ``` 13 | 14 | mvn jasypt:encrypt-value -Djasypt.encryptor.password="123456" -Djasypt.plugin.value="root123456!" 15 | mvn jasypt:decrypt-value -Djasypt.encryptor.password="123456" -Djasypt.plugin.value="密文" 16 | mvn jasypt:encrypt-value -Djasypt.encryptor.password="test" -Djasypt.plugin.value="root123456" 17 | 18 | mvn jasypt:decrypt-value -Djasypt.encryptor.password="123456" -Djasypt.plugin.value="密文" 19 | 20 | --jasypt.encryptor.password=sec123456 21 | https://blog.csdn.net/weixin_48903815/article/details/142494436 22 | 23 | ``` 24 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/common/ApiException.java: -------------------------------------------------------------------------------- 1 | package com.platform.common; 2 | 3 | 4 | import lombok.Data; 5 | 6 | @Data 7 | public class ApiException extends RuntimeException { 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | private String msg; 12 | 13 | private Integer code = 500; 14 | 15 | public ApiException(String errmsg) { 16 | super(errmsg); 17 | this.msg = errmsg; 18 | } 19 | 20 | public ApiException(String errmsg, Throwable e) { 21 | super(errmsg, e); 22 | this.msg = errmsg; 23 | } 24 | 25 | public ApiException(String errmsg, Integer errno) { 26 | super(errmsg); 27 | this.msg = errmsg; 28 | this.code = errno; 29 | } 30 | 31 | public ApiException(String errmsg, int errno, Throwable e) { 32 | super(errmsg, e); 33 | this.msg = errmsg; 34 | this.code = errno; 35 | } 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/config/AppExcelListener.java: -------------------------------------------------------------------------------- 1 | package com.platform.config; 2 | 3 | import com.alibaba.excel.context.AnalysisContext; 4 | import com.alibaba.excel.event.AnalysisEventListener; 5 | import lombok.Data; 6 | import lombok.extern.slf4j.Slf4j; 7 | import org.apache.poi.ss.formula.functions.T; 8 | 9 | import java.util.ArrayList; 10 | import java.util.List; 11 | import java.util.Map; 12 | 13 | /** 14 | * 读取 excel 15 | */ 16 | @Slf4j 17 | public class AppExcelListener extends AnalysisEventListener { 18 | 19 | // 创建list集合封装最终的数据 20 | private List list = new ArrayList<>(); 21 | public List getList() { 22 | return list; 23 | } 24 | 25 | //一行一行去读取excle内容 26 | @Override 27 | public void invoke(T user, AnalysisContext context) { 28 | // log.info(" invoke entity {}", user); 29 | list.add(user); 30 | } 31 | 32 | //读取excel表头信息 33 | @Override 34 | public void invokeHeadMap(Map headMap, AnalysisContext context) { 35 | log.info(" 表头信息 {}", headMap); 36 | } 37 | 38 | //读取完成后执行 39 | @Override 40 | public void doAfterAllAnalysed(AnalysisContext analysisContext) { 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/config/AppStaticConfig.java: -------------------------------------------------------------------------------- 1 | package com.platform.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; 6 | 7 | 8 | @Configuration 9 | public class AppStaticConfig extends WebMvcConfigurationSupport { 10 | 11 | @Override 12 | protected void addResourceHandlers(ResourceHandlerRegistry registry) { 13 | registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/"); 14 | // registry.addResourceHandler("/favicon.ico").addResourceLocations("classpath:/static/"); 15 | // super.addResourceHandlers(registry); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/config/AppWebMvcConfig.java: -------------------------------------------------------------------------------- 1 | package com.platform.config; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.beans.factory.annotation.Qualifier; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.core.task.AsyncTaskExecutor; 7 | import org.springframework.web.servlet.config.annotation.*; 8 | 9 | 10 | @Configuration 11 | public class AppWebMvcConfig implements WebMvcConfigurer { 12 | 13 | @Autowired 14 | private PassionInterceptor interceptor; 15 | 16 | @Autowired 17 | @Qualifier("mvcAsyncTaskExecutor") 18 | private AsyncTaskExecutor asyncTaskExecutor; 19 | 20 | @Override 21 | public void addInterceptors(InterceptorRegistry registry) { 22 | registry.addInterceptor(interceptor).addPathPatterns("/**"); 23 | } 24 | 25 | 26 | @Override 27 | public void configureAsyncSupport(AsyncSupportConfigurer configurer) { 28 | // 异步操作的超时时间,值为0或者更小,表示永不超时 29 | configurer.setDefaultTimeout(60_000); 30 | configurer.setTaskExecutor(asyncTaskExecutor); 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/config/Person.java: -------------------------------------------------------------------------------- 1 | package com.platform.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.stereotype.Component; 6 | 7 | import java.util.Date; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | /** 12 | * @Description 13 | * @Author kaiyang 14 | * @Date 2024-02-27 3:06 下午 15 | */ 16 | 17 | @Data 18 | @Component 19 | @ConfigurationProperties(prefix = "person") 20 | public class Person { 21 | 22 | private String lastName; 23 | 24 | private Integer age; 25 | 26 | private Boolean boss; 27 | 28 | private Date birth; 29 | 30 | private Map maps; 31 | 32 | private List lists; 33 | 34 | private Map> varmaplist; 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/controller/GiteeThirdController.java: -------------------------------------------------------------------------------- 1 | package com.platform.controller; 2 | 3 | 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.springframework.stereotype.Controller; 6 | 7 | /** 8 | * https://gitee.com/api/v5/oauth_doc 9 | */ 10 | @Slf4j 11 | @Controller 12 | public class GiteeThirdController { 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/dto/AppExcelDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.dto; 2 | 3 | import com.alibaba.excel.annotation.ExcelProperty; 4 | import com.alibaba.excel.annotation.write.style.ColumnWidth; 5 | import com.alibaba.excel.annotation.write.style.ContentRowHeight; 6 | import com.alibaba.excel.annotation.write.style.HeadRowHeight; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | 10 | import java.io.Serializable; 11 | 12 | /** 13 | * @Description 14 | * @Author kaiyang 15 | * @Date 2024-04-12 10:08 AM 16 | */ 17 | 18 | @ContentRowHeight(20)// 表体行高 19 | @HeadRowHeight(20)// 表头行高 20 | @ColumnWidth(14)// 列宽 21 | @Data 22 | @NoArgsConstructor 23 | public class AppExcelDto implements Serializable { 24 | 25 | private static final long serialVersionUID = -5524846652762595935L; 26 | @ExcelProperty(value = "姓名", index = 0) 27 | private String name; 28 | 29 | 30 | @ExcelProperty(value = "地址", index = 1) 31 | private String address; 32 | 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/dto/Result.java: -------------------------------------------------------------------------------- 1 | package com.platform.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @Description 9 | * @Author kaiyang 10 | * @Date 2024-01-25 10:51 AM 11 | */ 12 | 13 | @Data 14 | public class Result implements Serializable { 15 | 16 | 17 | private static final long serialVersionUID = 1268337253895534051L; 18 | private Integer code; 19 | 20 | private String msg; 21 | 22 | private T data; 23 | 24 | public static Result success(T data) { 25 | Result result = new Result<>(); 26 | result.setCode(200); 27 | result.setMsg("成功"); 28 | result.setData(data); 29 | return result; 30 | } 31 | 32 | public static Result failure(String msg) { 33 | Result result = new Result<>(); 34 | result.setCode(200); 35 | result.setMsg(msg); 36 | return result; 37 | } 38 | 39 | public static Result failure() { 40 | return failure("失败"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/dto/SftpDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @Description 9 | * @Author kaiyang 10 | * @Date 2024-03-15 2:23 PM 11 | */ 12 | 13 | @Data 14 | public class SftpDto implements Serializable { 15 | 16 | 17 | // 日期 18 | private String date; 19 | 20 | // 文件名称 21 | private String file; 22 | 23 | // 路径 24 | private String path; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/dto/StockCompDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.dto; 2 | 3 | import com.platform.entity.StockInfo; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.math.BigDecimal; 8 | import java.util.List; 9 | 10 | /** 11 | * @Description stock 对比 12 | * @Date 2023-08-24 3:15 PM 13 | */ 14 | 15 | @Data 16 | public class StockCompDto implements Serializable { 17 | 18 | private static final long serialVersionUID = 3354872856655422759L; 19 | 20 | private String code; 21 | 22 | private String name; 23 | 24 | private BigDecimal price; 25 | 26 | private BigDecimal rate; 27 | 28 | private List list; 29 | 30 | public StockCompDto(String code, String name) { 31 | this.code = code; 32 | this.name = name; 33 | } 34 | public StockCompDto(String code, String name,List list ) { 35 | this.code = code; 36 | this.name = name; 37 | this.list = list; 38 | } 39 | 40 | public StockCompDto() { 41 | } 42 | 43 | public static void main(String[] args) { 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/dto/StockInfoDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.dto; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | public class StockInfoDto { 10 | 11 | 12 | private List codeList; 13 | 14 | private List> dataList; 15 | 16 | 17 | private JSONObject colors; 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/dto/StockLineDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.dto; 2 | 3 | 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.math.BigDecimal; 8 | 9 | @Data 10 | public class StockLineDto implements Serializable { 11 | 12 | private static final long serialVersionUID = 5673912298211556416L; 13 | 14 | // 日期 15 | private String date; 16 | 17 | // 代码 18 | private String code; 19 | // 名称 20 | private String name; 21 | 22 | // 变动比例 23 | private BigDecimal rate; 24 | 25 | // 价格 26 | private BigDecimal price; 27 | 28 | 29 | 30 | } 31 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/dto/student.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package example; 3 | 4 | import "google/protobuf/timestamp.proto"; 5 | 6 | // java 配置 7 | option java_package = "com.platform.dto"; 8 | option java_outer_classname = "Stu"; 9 | 10 | // option optimize_for = LITE_RUNTIME; 11 | 12 | message Student { 13 | 14 | int64 id = 1; 15 | string name = 2; 16 | double weight = 3; 17 | int64 seq = 4; 18 | string address = 5; 19 | Direction direct = 6; 20 | bool flag = 7; 21 | google.protobuf.Timestamp birthday = 8; 22 | 23 | } 24 | 25 | enum Direction { 26 | 27 | LEFT = 0; 28 | RIGHT = 1; 29 | UP = 2; 30 | DOWN = 3; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/entity/ItemInfo.java: -------------------------------------------------------------------------------- 1 | package com.platform.entity; 2 | 3 | 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.fasterxml.jackson.annotation.JsonFormat; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | import java.util.Date; 10 | 11 | @Data 12 | public class ItemInfo implements Serializable { 13 | 14 | private static final long serialVersionUID = 5635589870012761613L; 15 | 16 | /** 推拿项目id */ 17 | private Long id; 18 | 19 | /** 项目名称 */ 20 | private String itemName; 21 | 22 | /** 项目时长,单位为分钟 */ 23 | private Long costTime; 24 | 25 | /** 简介 */ 26 | private String brief; 27 | 28 | 29 | /** 30 | * 创建者 31 | */ 32 | private String createBy; 33 | 34 | /** 35 | * 创建时间 36 | */ 37 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") 38 | private Date createTime; 39 | 40 | /** 41 | * 更新者 42 | */ 43 | @TableField(exist = false) 44 | private String updateBy; 45 | 46 | /** 47 | * 更新时间 48 | */ 49 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") 50 | private Date updateTime; 51 | 52 | /** 53 | * 备注 54 | */ 55 | private String remark; 56 | } 57 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/entity/Masseur.java: -------------------------------------------------------------------------------- 1 | package com.platform.entity; 2 | 3 | 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.util.List; 8 | 9 | @Data 10 | public class Masseur implements Serializable { 11 | 12 | private static final long serialVersionUID = 6207223812626144515L; 13 | 14 | private Long id; 15 | 16 | private String realName; 17 | 18 | // 绑定的项目id 19 | private List items; 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/entity/ReservationDetail.java: -------------------------------------------------------------------------------- 1 | package com.platform.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | import java.util.Date; 10 | 11 | /** 12 | * 用户预约明细表 13 | */ 14 | @Data 15 | @TableName("tb_reservation_detail") 16 | public class ReservationDetail implements Serializable { 17 | 18 | private static final long serialVersionUID = 1L; 19 | 20 | // 预约明细id 21 | @TableId(value = "id", type = IdType.AUTO) 22 | private Long id; 23 | 24 | // 预约号 25 | private String resId; 26 | 27 | // 技师id 28 | private Long masseurId; 29 | 30 | // 预约日期 31 | private String reservationDate; 32 | 33 | // 预约时间 34 | private String reservationTime; 35 | 36 | private Long seq; 37 | 38 | // 创建时间 39 | private Date createTime; 40 | 41 | // 更新时间 42 | private Date updateTime; 43 | 44 | // 备注 45 | private String remark; 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/mapper/EtfInfoMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.platform.entity.EtfInfo; 5 | 6 | /** 7 | *

8 | * 基金基本信息表 Mapper 接口 9 | *

10 | * 11 | * @author destiny 12 | * @since 2023-08-25 13 | */ 14 | public interface EtfInfoMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/mapper/FundInfoMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.platform.entity.FundInfo; 5 | 6 | /** 7 | * 基金基本信息表 Mapper 接口 8 | */ 9 | public interface FundInfoMapper extends BaseMapper { 10 | 11 | /** 12 | * 保存基金信息 13 | */ 14 | Integer saveFundInfo(FundInfo fund); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/mapper/StockInfoMapper.java: -------------------------------------------------------------------------------- 1 | package com.platform.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.platform.entity.StockInfo; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @Description 10 | * @Date 2023-08-07 9:44 AM 11 | */ 12 | public interface StockInfoMapper extends BaseMapper { 13 | 14 | 15 | Integer saveStockInfo(StockInfo info); 16 | 17 | /** 18 | * 查询股票信息列表 19 | * @param info 20 | * @return 21 | */ 22 | List selectStockList(StockInfo info); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/pojo/base/BaseResp.java: -------------------------------------------------------------------------------- 1 | package com.platform.pojo.base; 2 | 3 | 4 | import lombok.Data; 5 | import org.springframework.http.HttpStatus; 6 | 7 | @Data 8 | public class BaseResp { 9 | 10 | private Integer code; 11 | 12 | private String msg; 13 | 14 | private T data; 15 | 16 | public BaseResp() { 17 | this.code = HttpStatus.OK.value(); 18 | this.msg = "请求成功"; 19 | } 20 | 21 | public BaseResp(Integer code, String msg) { 22 | this.code = code; 23 | this.msg = msg; 24 | } 25 | 26 | public BaseResp(Integer code, String msg, T data) { 27 | this.code = code; 28 | this.msg = msg; 29 | this.data = data; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/pojo/dto/BaseInfoDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.pojo.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | 8 | /** 9 | * @Description 10 | * @Author liangkaiyang 11 | * @Date 2024-11-28 5:45 PM 12 | */ 13 | 14 | @Data 15 | public class BaseInfoDto implements Serializable { 16 | 17 | private static final long serialVersionUID = 3048710231855541292L; 18 | 19 | // id 20 | private Long id; 21 | 22 | // 订单Id 23 | private Long orderId; 24 | 25 | // 订单号 26 | private String orderNo; 27 | 28 | // 订单状态 29 | private String status; 30 | 31 | // 预约单号 32 | private String resId; 33 | 34 | // 预支付单号 35 | private String prepayId; 36 | 37 | // 失效时间 38 | private Date expireTime; 39 | 40 | private String msg; 41 | 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/pojo/dto/MassBusyDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.pojo.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * @Description 9 | * @Author liangkaiyang 10 | * @Date 2025-04-23 3:33 PM 11 | */ 12 | 13 | @Data 14 | public class MassBusyDto { 15 | 16 | // 已约日期 2024-12-01,当前时间之后的7天内预约情况 17 | private String date; 18 | 19 | // 已约时间 09:30 20 | private List timeList; 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/pojo/dto/TimeNode.java: -------------------------------------------------------------------------------- 1 | package com.platform.pojo.dto; 2 | 3 | 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | 8 | /** 9 | * @Description 10 | * @Author liangkaiyang 11 | * @Date 2024-12-13 6:55 PM 12 | */ 13 | 14 | 15 | @Data 16 | @AllArgsConstructor 17 | public class TimeNode { 18 | 19 | @ApiModelProperty(value = "时间点") 20 | private String time; 21 | 22 | @ApiModelProperty(value = "0 不可用, 1 可用") 23 | private Integer status; 24 | 25 | private String msg; 26 | 27 | 28 | 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/pojo/hold.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedestiny/springboot-auth/72f7f52f02ddbd42bdba6678d784651084484894/sandbox-stock/src/main/java/com/platform/pojo/hold.md -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/pojo/req/BaseReq.java: -------------------------------------------------------------------------------- 1 | package com.platform.pojo.req; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * @Description 7 | * @Author liangkaiyang 8 | * @Date 2025-04-23 3:29 PM 9 | */ 10 | 11 | @Data 12 | public class BaseReq { 13 | 14 | 15 | // 人员id 16 | private Long masseurId; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/pojo/req/ResDetailNode.java: -------------------------------------------------------------------------------- 1 | package com.platform.pojo.req; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import lombok.Data; 5 | import org.springframework.format.annotation.DateTimeFormat; 6 | 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | 10 | @Data 11 | public class ResDetailNode implements Serializable { 12 | 13 | private static final long serialVersionUID = -6602859851246954580L; 14 | 15 | // 项目id 16 | private Long itemId; 17 | 18 | private String itemName; 19 | 20 | private Integer costTime; 21 | 22 | // 服务人员id 23 | private Long masseurId; 24 | 25 | // 开始时间 26 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") 27 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") 28 | private Date startTime; 29 | 30 | // 结束时间 31 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") 32 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") 33 | private Date endTime; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/pojo/req/ReservationReq.java: -------------------------------------------------------------------------------- 1 | package com.platform.pojo.req; 2 | 3 | 4 | import lombok.Data; 5 | 6 | import javax.validation.constraints.NotEmpty; 7 | import java.io.Serializable; 8 | import java.util.List; 9 | 10 | /** 11 | * 预约请求对象 12 | */ 13 | @Data 14 | public class ReservationReq implements Serializable { 15 | 16 | private static final long serialVersionUID = 3280581026430789321L; 17 | 18 | @NotEmpty(message = "店铺id不能为空") 19 | private Long shopId; 20 | 21 | @NotEmpty(message = "预约明细不能为空") 22 | private List nodeList; 23 | 24 | private Long userId; 25 | 26 | @NotEmpty(message = "项目id不能为空") 27 | private Long itemId; 28 | 29 | private Long masseurId; 30 | 31 | // 用户预约id列表 32 | private List resIdList; 33 | 34 | // 是否新增预约 1 是 0 否,如果不是新增,会删除之前的shopId-itemId-masseurId预约信息, 默认值 1-是 35 | private Integer addFlag; 36 | 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/pojo/res/MasseurDetailRes.java: -------------------------------------------------------------------------------- 1 | package com.platform.pojo.res; 2 | 3 | import com.platform.pojo.dto.MassBusyDto; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @Description 11 | * @Author liangkaiyang 12 | * @Date 2025-04-23 3:30 PM 13 | */ 14 | 15 | @Data 16 | public class MasseurDetailRes { 17 | 18 | @ApiModelProperty(value = "家政服务人员id") 19 | private Long id; 20 | 21 | @ApiModelProperty(value = "服务人员头像") 22 | private String avatar; 23 | 24 | @ApiModelProperty(value = "推荐店铺信息") 25 | private ShopInfoRes shopInfo; 26 | 27 | @ApiModelProperty(value = "服务人员昵称") 28 | private String nickName; 29 | 30 | @ApiModelProperty(value = "服务人员名称") 31 | private String realName; 32 | 33 | @ApiModelProperty(value = "服务人员关联项目信息") 34 | private List itemList; 35 | 36 | @ApiModelProperty(value = "已约时间段,当前时间之后7天内的记录") 37 | private List busyList; 38 | 39 | 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/senstive/PhoneSensitivity.java: -------------------------------------------------------------------------------- 1 | package com.platform.senstive; 2 | 3 | 4 | 5 | 6 | import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; 7 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 8 | 9 | import java.lang.annotation.ElementType; 10 | import java.lang.annotation.Retention; 11 | import java.lang.annotation.RetentionPolicy; 12 | import java.lang.annotation.Target; 13 | 14 | /** 15 | * 配置脱敏注解 16 | */ 17 | @Retention(RetentionPolicy.RUNTIME) 18 | @Target(ElementType.FIELD) 19 | @JacksonAnnotationsInside 20 | @JsonSerialize(using = SensitiveSerializer.class) 21 | public @interface PhoneSensitivity { 22 | 23 | SensitiveEnum strategy() default SensitiveEnum.PHONE; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/senstive/Sensitivity.java: -------------------------------------------------------------------------------- 1 | package com.platform.senstive; 2 | 3 | 4 | import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; 5 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 6 | 7 | import java.lang.annotation.ElementType; 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.RetentionPolicy; 10 | import java.lang.annotation.Target; 11 | 12 | /** 13 | * 配置脱敏注解 14 | */ 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Target({ElementType.FIELD}) 17 | @JacksonAnnotationsInside 18 | @JsonSerialize(using = SensitiveSerializer.class) 19 | public @interface Sensitivity { 20 | 21 | SensitiveEnum strategy() default SensitiveEnum.USERNAME; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/service/ReservationService.java: -------------------------------------------------------------------------------- 1 | package com.platform.service; 2 | 3 | import com.platform.pojo.dto.BaseInfoDto; 4 | import com.platform.pojo.req.BaseReq; 5 | import com.platform.pojo.req.ReservationReq; 6 | import com.platform.pojo.req.ShopItemReq; 7 | import com.platform.pojo.res.MasseurDetailRes; 8 | import com.platform.pojo.res.MasseurInfoRes; 9 | 10 | import java.util.List; 11 | 12 | public interface ReservationService { 13 | 14 | /** 15 | * 创建预约信息 16 | */ 17 | BaseInfoDto createConsumerReservation(ReservationReq req); 18 | 19 | /** 20 | * 根据家政人员id 查询预约信息 21 | */ 22 | MasseurDetailRes queryMasseurInfo(BaseReq req); 23 | 24 | /** 25 | * 在店铺内查询项目信息 26 | */ 27 | List shopMasseurInfo(ShopItemReq req); 28 | } 29 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/service/StockService.java: -------------------------------------------------------------------------------- 1 | package com.platform.service; 2 | 3 | 4 | import com.platform.dto.FundDto; 5 | import com.platform.entity.EtfInfo; 6 | import com.platform.entity.StockInfo; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * @Description 12 | * @Date 2023-08-16 10:21 AM 13 | */ 14 | public interface StockService { 15 | 16 | 17 | /** 18 | * 保存场外基金信息 19 | * @param funds 20 | * @return 21 | */ 22 | Integer saveFundInfoList(List funds); 23 | 24 | /** 25 | * 保存 etf 信息 26 | */ 27 | Integer saveEtfInfoList(List etfs); 28 | 29 | /** 30 | * 查询 ETF 列表信息 31 | * @return 32 | */ 33 | List queryEtfInfoList(); 34 | 35 | /** 36 | * 更新 etf 信息 37 | */ 38 | Integer updateEtfInfo(EtfInfo etfInfo); 39 | 40 | /** 41 | * 保存 stock 信息 42 | */ 43 | Integer saveStockInfoList(List list); 44 | } 45 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/utils/FtpConfig.java: -------------------------------------------------------------------------------- 1 | package com.platform.utils; 2 | 3 | import cn.hutool.core.date.DateUtil; 4 | import lombok.Data; 5 | import org.springframework.boot.SpringBootConfiguration; 6 | import org.springframework.boot.context.properties.ConfigurationProperties; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | import java.io.Serializable; 10 | 11 | @Data 12 | @Configuration 13 | @ConfigurationProperties(value = "app.sftp") 14 | public class FtpConfig implements Serializable { 15 | 16 | private static final long serialVersionUID = 80865837754814947L; 17 | 18 | // ftp 地址 19 | private String hostname; 20 | // 端口 21 | private Integer port; 22 | // 用户名 23 | private String username; 24 | // 密码 25 | private String password; 26 | // 私钥 27 | private String privateKey; 28 | // 上传路径 29 | private String uploadPath = "/upload"; 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/utils/IdGenUtils.java: -------------------------------------------------------------------------------- 1 | package com.platform.utils; 2 | 3 | import cn.hutool.core.lang.Snowflake; 4 | 5 | public class IdGenUtils { 6 | 7 | public static final Snowflake flake; 8 | 9 | static { 10 | flake = new Snowflake(); 11 | } 12 | 13 | private IdGenUtils() { 14 | } 15 | 16 | public static Long getId(){ 17 | return flake.nextId(); 18 | } 19 | 20 | 21 | public static String getIdStr(){ 22 | return flake.nextIdStr(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/utils/JasyptTestUtils.java: -------------------------------------------------------------------------------- 1 | package com.platform.utils; 2 | 3 | 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.jasypt.util.text.BasicTextEncryptor; 6 | 7 | @Slf4j 8 | public class JasyptTestUtils { 9 | 10 | 11 | public static void main(String[] args) { 12 | 13 | 14 | // 创建 BasicTextEncryptor 对象进行简单的加密解密操作 15 | BasicTextEncryptor encryptor = new BasicTextEncryptor(); 16 | // 设置加密密钥,与应用程序中使用的密钥一致 17 | encryptor.setPassword("sec123456"); 18 | String encrypt = encryptor.encrypt("1234567"); 19 | // 加密密码 20 | System.out.println("加密内容 " + encrypt); 21 | 22 | String decrypt = encryptor.decrypt(encrypt); 23 | System.out.println("解密内容 " + decrypt); 24 | 25 | 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/utils/OrderCalNode.java: -------------------------------------------------------------------------------- 1 | package com.platform.utils; 2 | 3 | import cn.hutool.core.util.NumberUtil; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.math.BigDecimal; 8 | 9 | /** 10 | * 订单子单计算对象 11 | */ 12 | @Data 13 | public class OrderCalNode implements Serializable { 14 | 15 | private static final long serialVersionUID = -4305779956803150142L; 16 | 17 | // 订单id 18 | private String keyId; 19 | // 子单总金额 20 | private BigDecimal total; 21 | // 积分金额 22 | private BigDecimal point; 23 | // 积分实付 24 | private BigDecimal pointAct; 25 | // 现金金额 26 | private BigDecimal cash; 27 | // 膨胀金 28 | private BigDecimal expand; 29 | // 立减金额 30 | private BigDecimal inflation; 31 | 32 | // 计算现金和积分总金额 33 | public void calculateCashPoint() { 34 | this.cash = NumberUtil.sub(total, pointAct, expand, inflation); 35 | this.point = NumberUtil.add(pointAct, expand, inflation); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/utils/RequestIdHelper.java: -------------------------------------------------------------------------------- 1 | package com.platform.utils; 2 | 3 | import cn.hutool.core.lang.Snowflake; 4 | 5 | public class RequestIdHelper { 6 | 7 | 8 | 9 | public static Snowflake flake; 10 | 11 | static { 12 | flake = new Snowflake(); 13 | } 14 | 15 | 16 | public static String generate() { 17 | return flake.nextIdStr(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/utils/encdec/ParamEncryptDto.java: -------------------------------------------------------------------------------- 1 | package com.platform.utils.encdec; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * @Description 10 | * @Author liangkaiyang 11 | * @Date 2025-06-04 10:53 AM 12 | */ 13 | 14 | @Data 15 | public class ParamEncryptDto implements Serializable { 16 | 17 | 18 | private String appId; 19 | 20 | private String encryptData; 21 | 22 | private String encryptKey; 23 | 24 | public String toJSON(){ 25 | return JSON.toJSONString(this); 26 | } 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/utils/encdec/ServerTest.java: -------------------------------------------------------------------------------- 1 | package com.platform.utils.encdec; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.http.HttpEntity; 5 | import org.springframework.http.HttpHeaders; 6 | 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | 10 | import org.springframework.web.client.RestTemplate; 11 | 12 | /** 13 | * @Description 14 | * @Author liangkaiyang 15 | * @Date 2025-06-04 2:50 PM 16 | */ 17 | 18 | @Slf4j 19 | public class ServerTest { 20 | 21 | 22 | public static void main(String[] args) { 23 | 24 | 25 | RestTemplate restTemplate = new RestTemplate(); 26 | 27 | Map param = new HashMap<>(); 28 | param.put("age", "345"); 29 | param.put("address", "河南郑州市巩义市"); 30 | 31 | HttpHeaders headers = new HttpHeaders(); 32 | headers.set("appId", "100100"); 33 | headers.set("Content-Type", "application/json"); 34 | 35 | HttpEntity> httpEntity = new HttpEntity<>(param, headers); 36 | String body = restTemplate.postForObject("http://localhost:8080/api/v1/test/data", httpEntity, String.class); 37 | log.info("响应信息 resp :{}", body); 38 | 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/java/com/platform/utils/encdec/encryption-decryption.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedestiny/springboot-auth/72f7f52f02ddbd42bdba6678d784651084484894/sandbox-stock/src/main/java/com/platform/utils/encdec/encryption-decryption.md -------------------------------------------------------------------------------- /sandbox-stock/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | log.mask.enable=true 2 | log.mask.path=com.platform 3 | log.mask.keyword=true 4 | log.mask.regrex=false 5 | 6 | log.mask.keywordMap = {{ "name": "username,realname,nickname", "email": "email", "idCard": "idCard,cardNo", "address": "address", "phone": "phone,cellphone,mobile", "bank": "bank,bankcard" }} 7 | log.mask.regrexMap = {{ "name": "1", "email": "1", "idCard": "1", "address": "1", "phone": "1", "bank": "1" }} 8 | 9 | # enc 加密内容 10 | app.hobbyList.lilei[0]=44444 11 | app.hobbyList.lilei[1]=12222 12 | app.hobbyList.lilei[2]=33455 13 | 14 | # jasypt.encryptor.password=sec123456 15 | 16 | 17 | app.name=2222 18 | # ENC(SKryv4ywSHtQNMl90coCpA==) 19 | 20 | app.service.uri= {"/test/list": "/service-name","/test/list1": "/service-name"} 21 | app.service.server=test.com 22 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/resources/logback-spring-bak.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /sandbox-stock/src/main/resources/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedestiny/springboot-auth/72f7f52f02ddbd42bdba6678d784651084484894/sandbox-stock/src/main/resources/static/favicon.ico -------------------------------------------------------------------------------- /sandbox-stock/src/main/resources/static/hold.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedestiny/springboot-auth/72f7f52f02ddbd42bdba6678d784651084484894/sandbox-stock/src/main/resources/static/hold.md -------------------------------------------------------------------------------- /script/route_data.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "predicates": [ 4 | { 5 | "args": { 6 | "pattern": "/order/**" 7 | }, 8 | "name": "Path" 9 | } 10 | ], 11 | "id": "order-server", 12 | "filters": [ 13 | { 14 | "args": { 15 | "parts": 0 16 | }, 17 | "name": "StripPrefix" 18 | } 19 | ], 20 | "uri": "lb://order-server", 21 | "order": 1 22 | }, 23 | { 24 | "predicates": [ 25 | { 26 | "args": { 27 | "pattern": "/user/**" 28 | }, 29 | "name": "Path" 30 | } 31 | ], 32 | "id": "user-server", 33 | "filters": [ 34 | { 35 | "args": { 36 | "parts": 0 37 | }, 38 | "name": "StripPrefix" 39 | } 40 | ], 41 | "uri": "lb://user-server", 42 | "order": 1 43 | } 44 | ] -------------------------------------------------------------------------------- /script/sys.sql: -------------------------------------------------------------------------------- 1 | 2 | CREATE TABLE `tb_menu` ( 3 | `id` int NOT NULL AUTO_INCREMENT COMMENT '主键', 4 | `name` varchar(64) NOT NULL COMMENT '菜单名称', 5 | `seq` int NULL COMMENT '序号', 6 | `parent_id` int NULL COMMENT '父级id', 7 | `create_time` datetime(6) DEFAULT NULL COMMENT '创建时间', 8 | `update_time` datetime(6) DEFAULT NULL COMMENT '更新时间', 9 | PRIMARY KEY (`id`) USING BTREE 10 | ) ENGINE=InnoDB AUTO_INCREMENT=300 DEFAULT CHARSET=utf8mb4 COMMENT='菜单表'; 11 | 12 | 13 | -------------------------------------------------------------------------------- /vue-learn/vue_001.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 测试页面 6 | 7 | 8 | 9 |
10 | 11 |

{{message}}

12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
{{index}}{{item.id}}{{item.age}}{{item.name}}
22 | 23 |
24 | 25 | 26 | 27 | 28 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /vue-learn/vue_learn.md: -------------------------------------------------------------------------------- 1 | ``` 2 |
3 | data() { 4 | return { 5 | aliform: "", 6 | }; 7 | }, 8 | methods: { 9 | async iosAlipay(orderCode) { 10 | // 等待结果响应 11 | let data = await requestAlipay(orderCode); 12 | if (data.code == 200) { 13 | this.aliform = data.data; //data.data就是支付宝返回给你的form,获取到的表单内容,具体样子可见上面的图片 14 | this.$nextTick(() => { 15 | // 获取订单详情来轮询支付结果 16 | console.log(document.forms); //跳转之前,可以先打印看看forms,确保后台数据和forms正确,否则,可能会出现一些奇奇怪怪的问题 17 | document.forms[0].submit(); //重点--这个才是跳转页面的核心,获取第一个表单并提交 18 | }); 19 | } 20 | }, 21 | 22 | 23 | ``` 24 | 25 | 26 | ``` 27 | 28 | 29 | const newWindow = window.open('', '_self'); 30 | newWindow.document.write(result); 31 | newWindow.focus(); 32 | 33 | ------------------ 34 | 35 | const div = document.createElement('formdiv'); 36 | div.innerHTML = result; 37 | document.body.appendChild(div); 38 | document.forms[0].submit(); 39 | div.remove(); 40 | 41 | document.forms['cashierSubmit'].setAttribute('target', '_self'); 42 | document.forms['cashierSubmit'].submit(); 43 | ``` 44 | --------------------------------------------------------------------------------