├── .gitignore ├── .idea └── icon.png ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── LICENSE ├── README.md ├── checkstyle ├── 12306_checkstyle.xml └── 12306_checkstyle_suppression.xml ├── console-vue ├── .browserslistrc ├── .gitignore ├── .prettierrc ├── README.md ├── babel.config.js ├── jsconfig.json ├── package.json ├── public │ ├── favicon.ico │ └── index.html ├── src │ ├── App.vue │ ├── assets │ │ ├── black_dot.png │ │ └── logo.png │ ├── components │ │ ├── bread-header │ │ │ └── index.vue │ │ ├── header │ │ │ └── index.vue │ │ ├── icon-font │ │ │ └── index.vue │ │ └── sider │ │ │ └── index.vue │ ├── constants │ │ └── index.js │ ├── global.less │ ├── main.js │ ├── mock │ │ └── index.js │ ├── router │ │ └── index.js │ ├── service │ │ ├── axios.js │ │ └── index.js │ ├── utils │ │ └── index.js │ └── views │ │ ├── add-passenger │ │ └── index.vue │ │ ├── ali-pay │ │ └── index.vue │ │ ├── buy-ticket │ │ └── index.vue │ │ ├── check-order │ │ └── index.vue │ │ ├── login │ │ └── index.vue │ │ ├── my-ticket │ │ └── index.vue │ │ ├── order-list │ │ ├── components │ │ │ ├── edit-content │ │ │ │ └── index.vue │ │ │ ├── refund-ticket │ │ │ │ └── index.vue │ │ │ └── show-card-info │ │ │ │ └── index.vue │ │ └── index.vue │ │ ├── order │ │ └── index.vue │ │ ├── passenger │ │ └── index.vue │ │ ├── pay-success │ │ └── index.vue │ │ ├── personalTicket │ │ └── index.vue │ │ ├── ticket-serach │ │ └── index.vue │ │ └── user-info │ │ └── index.vue ├── vue.config.js └── yarn.lock ├── dependencies └── pom.xml ├── format ├── 12306_spotless_formatter.xml └── copyright.txt ├── frameworks ├── base │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── opengoofy │ │ │ └── index12306 │ │ │ └── framework │ │ │ └── starter │ │ │ └── bases │ │ │ ├── ApplicationContextHolder.java │ │ │ ├── Singleton.java │ │ │ ├── config │ │ │ └── ApplicationBaseAutoConfiguration.java │ │ │ ├── constant │ │ │ ├── FilterOrderConstant.java │ │ │ └── UserConstant.java │ │ │ ├── init │ │ │ ├── ApplicationContentPostProcessor.java │ │ │ └── ApplicationInitializingEvent.java │ │ │ └── safa │ │ │ └── FastJsonSafeMode.java │ │ └── resources │ │ └── META-INF │ │ └── spring │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports ├── bizs │ ├── pom.xml │ └── user │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── opengoofy │ │ │ └── index12306 │ │ │ └── frameworks │ │ │ └── starter │ │ │ └── user │ │ │ ├── config │ │ │ └── UserAutoConfiguration.java │ │ │ ├── core │ │ │ ├── UserContext.java │ │ │ ├── UserInfoDTO.java │ │ │ └── UserTransmitFilter.java │ │ │ └── toolkit │ │ │ └── JWTUtil.java │ │ └── resources │ │ └── META-INF │ │ └── spring │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports ├── cache │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── opengoofy │ │ │ └── index12306 │ │ │ └── framework │ │ │ └── starter │ │ │ └── cache │ │ │ ├── Cache.java │ │ │ ├── DistributedCache.java │ │ │ ├── MultistageCache.java │ │ │ ├── RedisKeySerializer.java │ │ │ ├── StringRedisTemplateProxy.java │ │ │ ├── config │ │ │ ├── BloomFilterPenetrateProperties.java │ │ │ ├── CacheAutoConfiguration.java │ │ │ └── RedisDistributedProperties.java │ │ │ ├── core │ │ │ ├── CacheGetFilter.java │ │ │ ├── CacheGetIfAbsent.java │ │ │ └── CacheLoader.java │ │ │ └── toolkit │ │ │ ├── CacheUtil.java │ │ │ └── FastJson2Util.java │ │ └── resources │ │ ├── META-INF │ │ └── spring │ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ │ └── lua │ │ └── putIfAllAbsent.lua ├── common │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── opengoofy │ │ └── index12306 │ │ └── framework │ │ └── starter │ │ └── common │ │ ├── enums │ │ ├── DelEnum.java │ │ ├── FlagEnum.java │ │ ├── OperationTypeEnum.java │ │ └── StatusEnum.java │ │ ├── threadpool │ │ ├── build │ │ │ ├── ThreadFactoryBuilder.java │ │ │ └── ThreadPoolBuilder.java │ │ ├── proxy │ │ │ ├── RejectedProxyInvocationHandler.java │ │ │ └── RejectedProxyUtil.java │ │ └── support │ │ │ └── eager │ │ │ ├── EagerThreadPoolExecutor.java │ │ │ └── TaskQueue.java │ │ └── toolkit │ │ ├── Assert.java │ │ ├── BeanUtil.java │ │ ├── EnvironmentUtil.java │ │ └── ThreadUtil.java ├── convention │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── opengoofy │ │ └── index12306 │ │ └── framework │ │ └── starter │ │ └── convention │ │ ├── errorcode │ │ ├── BaseErrorCode.java │ │ └── IErrorCode.java │ │ ├── exception │ │ ├── AbstractException.java │ │ ├── ClientException.java │ │ ├── RemoteException.java │ │ └── ServiceException.java │ │ ├── page │ │ ├── PageRequest.java │ │ └── PageResponse.java │ │ └── result │ │ └── Result.java ├── database │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── opengoofy │ │ │ └── index12306 │ │ │ └── framework │ │ │ └── starter │ │ │ └── database │ │ │ ├── algorithm │ │ │ └── sharding │ │ │ │ └── CustomDbHashModShardingAlgorithm.java │ │ │ ├── base │ │ │ └── BaseDO.java │ │ │ ├── config │ │ │ └── MybatisPlusAutoConfiguration.java │ │ │ ├── handler │ │ │ ├── CustomIdGenerator.java │ │ │ └── MyMetaObjectHandler.java │ │ │ └── toolkit │ │ │ └── PageUtil.java │ │ └── resources │ │ └── META-INF │ │ └── spring │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports ├── designpattern │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── opengoofy │ │ │ └── index12306 │ │ │ └── framework │ │ │ └── starter │ │ │ └── designpattern │ │ │ ├── builder │ │ │ └── Builder.java │ │ │ ├── chain │ │ │ ├── AbstractChainContext.java │ │ │ └── AbstractChainHandler.java │ │ │ ├── config │ │ │ └── DesignPatternAutoConfiguration.java │ │ │ └── strategy │ │ │ ├── AbstractExecuteStrategy.java │ │ │ └── AbstractStrategyChoose.java │ │ └── resources │ │ └── META-INF │ │ └── spring │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports ├── distributedid │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── opengoofy │ │ │ └── index12306 │ │ │ └── framework │ │ │ └── starter │ │ │ └── distributedid │ │ │ ├── config │ │ │ └── DistributedIdAutoConfiguration.java │ │ │ ├── core │ │ │ ├── IdGenerator.java │ │ │ ├── serviceid │ │ │ │ ├── DefaultServiceIdGenerator.java │ │ │ │ └── ServiceIdGenerator.java │ │ │ └── snowflake │ │ │ │ ├── AbstractWorkIdChooseTemplate.java │ │ │ │ ├── LocalRedisWorkIdChoose.java │ │ │ │ ├── RandomWorkIdChoose.java │ │ │ │ ├── Snowflake.java │ │ │ │ ├── SnowflakeIdInfo.java │ │ │ │ └── WorkIdWrapper.java │ │ │ ├── handler │ │ │ └── IdGeneratorManager.java │ │ │ └── toolkit │ │ │ └── SnowflakeIdUtil.java │ │ └── resources │ │ ├── META-INF │ │ └── spring │ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ │ └── lua │ │ └── chooseWorkIdLua.lua ├── idempotent │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── opengoofy │ │ │ └── index12306 │ │ │ └── framework │ │ │ └── starter │ │ │ └── idempotent │ │ │ ├── annotation │ │ │ ├── Idempotent.java │ │ │ ├── MQIdempotent.java │ │ │ └── RestAPIIdempotent.java │ │ │ ├── config │ │ │ ├── IdempotentAutoConfiguration.java │ │ │ └── IdempotentProperties.java │ │ │ ├── core │ │ │ ├── AbstractIdempotentExecuteHandler.java │ │ │ ├── IdempotentAspect.java │ │ │ ├── IdempotentContext.java │ │ │ ├── IdempotentExecuteHandler.java │ │ │ ├── IdempotentExecuteHandlerFactory.java │ │ │ ├── IdempotentParamWrapper.java │ │ │ ├── RepeatConsumptionException.java │ │ │ ├── param │ │ │ │ ├── IdempotentParamExecuteHandler.java │ │ │ │ └── IdempotentParamService.java │ │ │ ├── spel │ │ │ │ ├── IdempotentSpELByMQExecuteHandler.java │ │ │ │ ├── IdempotentSpELByRestAPIExecuteHandler.java │ │ │ │ └── IdempotentSpELService.java │ │ │ └── token │ │ │ │ ├── IdempotentTokenController.java │ │ │ │ ├── IdempotentTokenExecuteHandler.java │ │ │ │ └── IdempotentTokenService.java │ │ │ ├── enums │ │ │ ├── IdempotentMQConsumeStatusEnum.java │ │ │ ├── IdempotentSceneEnum.java │ │ │ └── IdempotentTypeEnum.java │ │ │ └── toolkit │ │ │ ├── LogUtil.java │ │ │ └── SpELUtil.java │ │ └── resources │ │ ├── META-INF │ │ └── spring │ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ │ └── lua │ │ └── set_if_absent_and_get.lua ├── log │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── opengoofy │ │ │ └── index12306 │ │ │ └── framework │ │ │ └── starter │ │ │ └── log │ │ │ ├── annotation │ │ │ └── ILog.java │ │ │ ├── config │ │ │ └── LogAutoConfiguration.java │ │ │ └── core │ │ │ ├── ILogPrintAspect.java │ │ │ └── ILogPrintDTO.java │ │ └── resources │ │ └── META-INF │ │ └── spring │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports ├── pom.xml └── web │ ├── pom.xml │ └── src │ └── main │ ├── java │ └── org │ │ └── opengoofy │ │ └── index12306 │ │ └── framework │ │ └── starter │ │ └── web │ │ ├── GlobalExceptionHandler.java │ │ ├── Results.java │ │ ├── config │ │ └── WebAutoConfiguration.java │ │ └── initialize │ │ ├── InitializeDispatcherServletController.java │ │ └── InitializeDispatcherServletHandler.java │ └── resources │ └── META-INF │ └── spring │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports ├── lombok.config ├── mvnw ├── mvnw.cmd ├── pom.xml ├── resources ├── data │ ├── 12306-springboot.sql │ ├── 12306-springcloud-ticket.sql │ └── 12306-springcloud-user.sql └── db │ ├── 12306-springboot.sql │ ├── 12306-springcloud-order.sql │ ├── 12306-springcloud-pay.sql │ ├── 12306-springcloud-ticket.sql │ └── 12306-springcloud-user.sql ├── services ├── aggregation-service │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── opengoofy │ │ │ └── index12306 │ │ │ └── biz │ │ │ └── aggregationservice │ │ │ ├── AggregationServiceApplication.java │ │ │ └── config │ │ │ ├── DemoModeConfiguration.java │ │ │ └── DemoModeProperties.java │ │ └── resources │ │ ├── application.yaml │ │ ├── shardingsphere-config-dev.yaml │ │ └── shardingsphere-config-prod.yaml ├── gateway-service │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── opengoofy │ │ │ │ └── index12306 │ │ │ │ └── biz │ │ │ │ └── gatewayservice │ │ │ │ ├── GatewayServiceApplication.java │ │ │ │ ├── config │ │ │ │ └── Config.java │ │ │ │ ├── filter │ │ │ │ └── TokenValidateGatewayFilterFactory.java │ │ │ │ └── toolkit │ │ │ │ ├── JWTUtil.java │ │ │ │ └── UserInfoDTO.java │ │ └── resources │ │ │ ├── application-aggregation.yaml │ │ │ ├── application-dev.yaml │ │ │ └── application.yaml │ │ └── test │ │ └── java │ │ └── org │ │ └── opengoofy │ │ └── index12306 │ │ └── biz │ │ └── gatewayservice │ │ └── GatewayServiceApplicationTests.java ├── order-service │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── opengoofy │ │ │ │ └── index12306 │ │ │ │ └── biz │ │ │ │ └── orderservice │ │ │ │ ├── OrderServiceApplication.java │ │ │ │ ├── common │ │ │ │ ├── constant │ │ │ │ │ └── OrderRocketMQConstant.java │ │ │ │ └── enums │ │ │ │ │ ├── OrderCanalErrorCodeEnum.java │ │ │ │ │ ├── OrderItemStatusEnum.java │ │ │ │ │ ├── OrderStatusEnum.java │ │ │ │ │ ├── PayChannelEnum.java │ │ │ │ │ └── RefundTypeEnum.java │ │ │ │ ├── controller │ │ │ │ └── TicketOrderController.java │ │ │ │ ├── dao │ │ │ │ ├── algorithm │ │ │ │ │ ├── OrderCommonDataBaseComplexAlgorithm.java │ │ │ │ │ └── OrderCommonTableComplexAlgorithm.java │ │ │ │ ├── entity │ │ │ │ │ ├── OrderDO.java │ │ │ │ │ ├── OrderItemDO.java │ │ │ │ │ └── OrderItemPassengerDO.java │ │ │ │ └── mapper │ │ │ │ │ ├── OrderItemMapper.java │ │ │ │ │ ├── OrderItemPassengerMapper.java │ │ │ │ │ └── OrderMapper.java │ │ │ │ ├── dto │ │ │ │ ├── domain │ │ │ │ │ ├── OrderItemStatusReversalDTO.java │ │ │ │ │ └── OrderStatusReversalDTO.java │ │ │ │ ├── req │ │ │ │ │ ├── CancelTicketOrderReqDTO.java │ │ │ │ │ ├── TicketOrderCreateReqDTO.java │ │ │ │ │ ├── TicketOrderItemCreateReqDTO.java │ │ │ │ │ ├── TicketOrderItemQueryReqDTO.java │ │ │ │ │ ├── TicketOrderPageQueryReqDTO.java │ │ │ │ │ └── TicketOrderSelfPageQueryReqDTO.java │ │ │ │ └── resp │ │ │ │ │ ├── TicketOrderDetailRespDTO.java │ │ │ │ │ ├── TicketOrderDetailSelfRespDTO.java │ │ │ │ │ └── TicketOrderPassengerDetailRespDTO.java │ │ │ │ ├── mq │ │ │ │ ├── consumer │ │ │ │ │ ├── PayResultCallbackOrderConsumer.java │ │ │ │ │ └── RefundResultCallbackOrderConsumer.java │ │ │ │ ├── domain │ │ │ │ │ └── MessageWrapper.java │ │ │ │ ├── event │ │ │ │ │ ├── DelayCloseOrderEvent.java │ │ │ │ │ ├── PayResultCallbackOrderEvent.java │ │ │ │ │ └── RefundResultCallbackOrderEvent.java │ │ │ │ └── produce │ │ │ │ │ ├── AbstractCommonSendProduceTemplate.java │ │ │ │ │ ├── BaseSendExtendDTO.java │ │ │ │ │ └── DelayCloseOrderSendProduce.java │ │ │ │ ├── remote │ │ │ │ ├── UserRemoteService.java │ │ │ │ └── dto │ │ │ │ │ └── UserQueryActualRespDTO.java │ │ │ │ ├── serialize │ │ │ │ ├── IdCardDesensitizationSerializer.java │ │ │ │ └── PhoneDesensitizationSerializer.java │ │ │ │ └── service │ │ │ │ ├── OrderItemService.java │ │ │ │ ├── OrderPassengerRelationService.java │ │ │ │ ├── OrderService.java │ │ │ │ ├── impl │ │ │ │ ├── OrderItemServiceImpl.java │ │ │ │ ├── OrderPassengerRelationServiceImpl.java │ │ │ │ └── OrderServiceImpl.java │ │ │ │ └── orderid │ │ │ │ ├── DistributedIdGenerator.java │ │ │ │ └── OrderIdGeneratorManager.java │ │ └── resources │ │ │ ├── META-INF │ │ │ └── spring │ │ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ │ │ ├── application.yaml │ │ │ └── shardingsphere-config.yaml │ │ └── test │ │ └── java │ │ └── org │ │ └── opengoofy │ │ └── index12306 │ │ └── biz │ │ └── orderservice │ │ └── OrderServiceApplicationTests.java ├── pay-service │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── opengoofy │ │ │ │ └── index12306 │ │ │ │ └── biz │ │ │ │ └── payservice │ │ │ │ ├── PayServiceApplication.java │ │ │ │ ├── common │ │ │ │ ├── constant │ │ │ │ │ ├── PayRocketMQConstant.java │ │ │ │ │ └── RedisKeyConstant.java │ │ │ │ └── enums │ │ │ │ │ ├── PayChannelEnum.java │ │ │ │ │ ├── PayTradeTypeEnum.java │ │ │ │ │ ├── RefundTypeEnum.java │ │ │ │ │ └── TradeStatusEnum.java │ │ │ │ ├── config │ │ │ │ └── AliPayProperties.java │ │ │ │ ├── controller │ │ │ │ ├── PayCallbackController.java │ │ │ │ ├── PayController.java │ │ │ │ └── RefundController.java │ │ │ │ ├── convert │ │ │ │ ├── PayCallbackRequestConvert.java │ │ │ │ ├── PayRequestConvert.java │ │ │ │ └── RefundRequestConvert.java │ │ │ │ ├── dao │ │ │ │ ├── algorithm │ │ │ │ │ ├── PayDataBaseComplexAlgorithm.java │ │ │ │ │ └── PayTableComplexAlgorithm.java │ │ │ │ ├── entity │ │ │ │ │ ├── PayDO.java │ │ │ │ │ └── RefundDO.java │ │ │ │ └── mapper │ │ │ │ │ ├── PayMapper.java │ │ │ │ │ └── RefundMapper.java │ │ │ │ ├── dto │ │ │ │ ├── PayCallbackCommand.java │ │ │ │ ├── PayCallbackReqDTO.java │ │ │ │ ├── PayCommand.java │ │ │ │ ├── PayCreateReqDTO.java │ │ │ │ ├── PayInfoRespDTO.java │ │ │ │ ├── PayRespDTO.java │ │ │ │ ├── RefundCommand.java │ │ │ │ ├── RefundCreateDTO.java │ │ │ │ ├── RefundReqDTO.java │ │ │ │ ├── RefundRespDTO.java │ │ │ │ └── base │ │ │ │ │ ├── AbstractPayCallbackRequest.java │ │ │ │ │ ├── AbstractPayRequest.java │ │ │ │ │ ├── AbstractRefundRequest.java │ │ │ │ │ ├── AliPayCallbackRequest.java │ │ │ │ │ ├── AliPayRequest.java │ │ │ │ │ ├── AliRefundRequest.java │ │ │ │ │ ├── PayCallbackRequest.java │ │ │ │ │ ├── PayRequest.java │ │ │ │ │ ├── PayResponse.java │ │ │ │ │ ├── RefundRequest.java │ │ │ │ │ └── RefundResponse.java │ │ │ │ ├── handler │ │ │ │ ├── AliPayCallbackHandler.java │ │ │ │ ├── AliPayNativeHandler.java │ │ │ │ ├── AliRefundNativeHandler.java │ │ │ │ └── base │ │ │ │ │ ├── AbstractPayCallbackHandler.java │ │ │ │ │ ├── AbstractPayHandler.java │ │ │ │ │ └── AbstractRefundHandler.java │ │ │ │ ├── mq │ │ │ │ ├── domain │ │ │ │ │ └── MessageWrapper.java │ │ │ │ ├── event │ │ │ │ │ ├── PayResultCallbackOrderEvent.java │ │ │ │ │ └── RefundResultCallbackOrderEvent.java │ │ │ │ └── produce │ │ │ │ │ ├── AbstractCommonSendProduceTemplate.java │ │ │ │ │ ├── BaseSendExtendDTO.java │ │ │ │ │ ├── PayResultCallbackOrderSendProduce.java │ │ │ │ │ └── RefundResultCallbackOrderSendProduce.java │ │ │ │ ├── remote │ │ │ │ ├── TicketOrderRemoteService.java │ │ │ │ └── dto │ │ │ │ │ ├── TicketOrderDetailRespDTO.java │ │ │ │ │ └── TicketOrderPassengerDetailRespDTO.java │ │ │ │ └── service │ │ │ │ ├── PayService.java │ │ │ │ ├── RefundService.java │ │ │ │ ├── impl │ │ │ │ ├── PayServiceImpl.java │ │ │ │ └── RefundServiceImpl.java │ │ │ │ └── payid │ │ │ │ ├── DistributedIdGenerator.java │ │ │ │ └── PayIdGeneratorManager.java │ │ └── resources │ │ │ ├── META-INF │ │ │ └── spring │ │ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ │ │ ├── application.yaml │ │ │ └── shardingsphere-config.yaml │ │ └── test │ │ └── java │ │ └── org │ │ └── opengoofy │ │ └── index12306 │ │ └── biz │ │ └── payservice │ │ └── PayServiceApplicationTests.java ├── pom.xml ├── ticket-service │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── opengoofy │ │ │ │ └── index12306 │ │ │ │ └── biz │ │ │ │ └── ticketservice │ │ │ │ ├── TicketServiceApplication.java │ │ │ │ ├── canal │ │ │ │ ├── OrderCloseCacheAndTokenUpdateHandler.java │ │ │ │ └── TicketAvailabilityCacheUpdateHandler.java │ │ │ │ ├── common │ │ │ │ ├── constant │ │ │ │ │ ├── Index12306Constant.java │ │ │ │ │ ├── RedisKeyConstant.java │ │ │ │ │ └── TicketRocketMQConstant.java │ │ │ │ └── enums │ │ │ │ │ ├── CanalExecuteStrategyMarkEnum.java │ │ │ │ │ ├── RefundTypeEnum.java │ │ │ │ │ ├── RegionStationQueryTypeEnum.java │ │ │ │ │ ├── SeatStatusEnum.java │ │ │ │ │ ├── SourceEnum.java │ │ │ │ │ ├── TicketChainMarkEnum.java │ │ │ │ │ ├── TicketStatusEnum.java │ │ │ │ │ ├── TrainBrandEnum.java │ │ │ │ │ ├── VehicleSeatTypeEnum.java │ │ │ │ │ └── VehicleTypeEnum.java │ │ │ │ ├── config │ │ │ │ └── Hippo4jThreadPoolConfiguration.java │ │ │ │ ├── controller │ │ │ │ ├── RegionStationController.java │ │ │ │ ├── TempSeatController.java │ │ │ │ ├── TicketController.java │ │ │ │ └── TrainStationController.java │ │ │ │ ├── dao │ │ │ │ ├── entity │ │ │ │ │ ├── CarriageDO.java │ │ │ │ │ ├── RegionDO.java │ │ │ │ │ ├── SeatDO.java │ │ │ │ │ ├── StationDO.java │ │ │ │ │ ├── TicketDO.java │ │ │ │ │ ├── TrainDO.java │ │ │ │ │ ├── TrainStationDO.java │ │ │ │ │ ├── TrainStationPriceDO.java │ │ │ │ │ └── TrainStationRelationDO.java │ │ │ │ └── mapper │ │ │ │ │ ├── CarriageMapper.java │ │ │ │ │ ├── RegionMapper.java │ │ │ │ │ ├── SeatMapper.java │ │ │ │ │ ├── StationMapper.java │ │ │ │ │ ├── TicketMapper.java │ │ │ │ │ ├── TrainMapper.java │ │ │ │ │ ├── TrainStationMapper.java │ │ │ │ │ ├── TrainStationPriceMapper.java │ │ │ │ │ └── TrainStationRelationMapper.java │ │ │ │ ├── dto │ │ │ │ ├── domain │ │ │ │ │ ├── BulletTrainDTO.java │ │ │ │ │ ├── HighSpeedTrainDTO.java │ │ │ │ │ ├── PurchaseTicketPassengerDetailDTO.java │ │ │ │ │ ├── RegularTrainDTO.java │ │ │ │ │ ├── RouteDTO.java │ │ │ │ │ ├── SeatClassDTO.java │ │ │ │ │ ├── SeatTypeCountDTO.java │ │ │ │ │ ├── TicketListDTO.java │ │ │ │ │ └── TrainSeatBaseDTO.java │ │ │ │ ├── req │ │ │ │ │ ├── CancelTicketOrderReqDTO.java │ │ │ │ │ ├── PurchaseTicketReqDTO.java │ │ │ │ │ ├── RefundTicketReqDTO.java │ │ │ │ │ ├── RegionStationQueryReqDTO.java │ │ │ │ │ ├── TicketOrderItemQueryReqDTO.java │ │ │ │ │ └── TicketPageQueryReqDTO.java │ │ │ │ └── resp │ │ │ │ │ ├── RefundTicketRespDTO.java │ │ │ │ │ ├── RegionStationQueryRespDTO.java │ │ │ │ │ ├── StationQueryRespDTO.java │ │ │ │ │ ├── TicketOrderDetailRespDTO.java │ │ │ │ │ ├── TicketPageQueryRespDTO.java │ │ │ │ │ ├── TicketPurchaseRespDTO.java │ │ │ │ │ └── TrainStationQueryRespDTO.java │ │ │ │ ├── job │ │ │ │ ├── RegionTrainStationJobHandler.java │ │ │ │ ├── TrainStationDetailJobHandler.java │ │ │ │ ├── TrainStationJobHandler.java │ │ │ │ ├── TrainStationRemainingTicketJobHandler.java │ │ │ │ └── base │ │ │ │ │ └── AbstractTrainStationJobHandlerTemplate.java │ │ │ │ ├── mq │ │ │ │ ├── consumer │ │ │ │ │ ├── CanalCommonSyncBinlogConsumer.java │ │ │ │ │ ├── DelayCloseOrderConsumer.java │ │ │ │ │ └── PayResultCallbackTicketConsumer.java │ │ │ │ ├── domain │ │ │ │ │ └── MessageWrapper.java │ │ │ │ └── event │ │ │ │ │ ├── CanalBinlogEvent.java │ │ │ │ │ ├── DelayCloseOrderEvent.java │ │ │ │ │ └── PayResultCallbackTicketEvent.java │ │ │ │ ├── remote │ │ │ │ ├── PayRemoteService.java │ │ │ │ ├── TicketOrderRemoteService.java │ │ │ │ ├── UserRemoteService.java │ │ │ │ └── dto │ │ │ │ │ ├── PassengerRespDTO.java │ │ │ │ │ ├── PayInfoRespDTO.java │ │ │ │ │ ├── RefundReqDTO.java │ │ │ │ │ ├── RefundRespDTO.java │ │ │ │ │ ├── TicketOrderCreateRemoteReqDTO.java │ │ │ │ │ ├── TicketOrderDetailRespDTO.java │ │ │ │ │ ├── TicketOrderItemCreateRemoteReqDTO.java │ │ │ │ │ └── TicketOrderPassengerDetailRespDTO.java │ │ │ │ ├── service │ │ │ │ ├── CarriageService.java │ │ │ │ ├── RegionStationService.java │ │ │ │ ├── SeatService.java │ │ │ │ ├── TicketService.java │ │ │ │ ├── TrainStationService.java │ │ │ │ ├── cache │ │ │ │ │ └── SeatMarginCacheLoader.java │ │ │ │ ├── handler │ │ │ │ │ └── ticket │ │ │ │ │ │ ├── TrainBusinessClassPurchaseTicketHandler.java │ │ │ │ │ │ ├── TrainFirstClassPurchaseTicketHandler.java │ │ │ │ │ │ ├── TrainSecondClassPurchaseTicketHandler.java │ │ │ │ │ │ ├── base │ │ │ │ │ │ ├── AbstractTrainPurchaseTicketTemplate.java │ │ │ │ │ │ ├── BitMapCheckSeat.java │ │ │ │ │ │ ├── BitMapCheckSeatStatusFactory.java │ │ │ │ │ │ ├── IPurchaseTicket.java │ │ │ │ │ │ ├── TrainBitMapCheckSeat.java │ │ │ │ │ │ ├── TrainBusinessCheckSeat.java │ │ │ │ │ │ ├── TrainFirstCheckSeat.java │ │ │ │ │ │ └── TrainSecondCheckSeat.java │ │ │ │ │ │ ├── dto │ │ │ │ │ │ ├── SelectSeatDTO.java │ │ │ │ │ │ ├── TokenResultDTO.java │ │ │ │ │ │ └── TrainPurchaseTicketRespDTO.java │ │ │ │ │ │ ├── filter │ │ │ │ │ │ ├── purchase │ │ │ │ │ │ │ ├── TrainPurchaseTicketChainFilter.java │ │ │ │ │ │ │ ├── TrainPurchaseTicketParamNotNullChainHandler.java │ │ │ │ │ │ │ ├── TrainPurchaseTicketParamStockChainHandler.java │ │ │ │ │ │ │ ├── TrainPurchaseTicketParamVerifyChainHandler.java │ │ │ │ │ │ │ └── TrainPurchaseTicketRepeatChainHandler.java │ │ │ │ │ │ ├── query │ │ │ │ │ │ │ ├── TrainTicketQueryChainFilter.java │ │ │ │ │ │ │ ├── TrainTicketQueryParamBaseVerifyChainFilter.java │ │ │ │ │ │ │ ├── TrainTicketQueryParamNotNullChainFilter.java │ │ │ │ │ │ │ └── TrainTicketQueryParamVerifyChainFilter.java │ │ │ │ │ │ └── refund │ │ │ │ │ │ │ ├── TrainRefundTicketChainFilter.java │ │ │ │ │ │ │ └── TrainRefundTicketParamNotNullChainFilter.java │ │ │ │ │ │ ├── select │ │ │ │ │ │ ├── SeatSelection.java │ │ │ │ │ │ └── TrainSeatTypeSelector.java │ │ │ │ │ │ └── tokenbucket │ │ │ │ │ │ └── TicketAvailabilityTokenBucket.java │ │ │ │ └── impl │ │ │ │ │ ├── CarriageServiceImpl.java │ │ │ │ │ ├── RegionStationImpl.java │ │ │ │ │ ├── SeatServiceImpl.java │ │ │ │ │ ├── TicketServiceImpl.java │ │ │ │ │ └── TrainStationServiceImpl.java │ │ │ │ └── toolkit │ │ │ │ ├── CarriageVacantSeatCalculateUtil.java │ │ │ │ ├── ChooseSeatUtil.java │ │ │ │ ├── DateUtil.java │ │ │ │ ├── SeatNumberUtil.java │ │ │ │ ├── StationCalculateUtil.java │ │ │ │ ├── SurplusNeedMatchSeatUtil.java │ │ │ │ └── TimeStringComparator.java │ │ └── resources │ │ │ ├── META-INF │ │ │ └── spring │ │ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ │ │ ├── application.yaml │ │ │ ├── lua │ │ │ ├── ticket_availability_rollback_token_bucket.lua │ │ │ └── ticket_availability_token_bucket.lua │ │ │ └── mapper │ │ │ └── SeatMapper.xml │ │ └── test │ │ └── java │ │ └── org │ │ └── opengoofy │ │ └── index12306 │ │ └── biz │ │ └── ticketservice │ │ ├── TicketSeatTests.java │ │ ├── TicketStationPriceTests.java │ │ ├── TicketStationRelationTests.java │ │ ├── TrainCarriageTests.java │ │ └── TrainStationTests.java └── user-service │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── opengoofy │ │ │ └── index12306 │ │ │ └── biz │ │ │ └── userservice │ │ │ ├── UserServiceApplication.java │ │ │ ├── common │ │ │ ├── constant │ │ │ │ ├── Index12306Constant.java │ │ │ │ └── RedisKeyConstant.java │ │ │ └── enums │ │ │ │ ├── UserChainMarkEnum.java │ │ │ │ ├── UserRegisterErrorCodeEnum.java │ │ │ │ └── VerifyStatusEnum.java │ │ │ ├── config │ │ │ ├── RBloomFilterConfiguration.java │ │ │ └── UserRegisterBloomFilterProperties.java │ │ │ ├── controller │ │ │ ├── PassengerController.java │ │ │ ├── UserInfoController.java │ │ │ └── UserLoginController.java │ │ │ ├── dao │ │ │ ├── entity │ │ │ │ ├── PassengerDO.java │ │ │ │ ├── UserDO.java │ │ │ │ ├── UserDeletionDO.java │ │ │ │ ├── UserMailDO.java │ │ │ │ ├── UserPhoneDO.java │ │ │ │ └── UserReuseDO.java │ │ │ └── mapper │ │ │ │ ├── PassengerMapper.java │ │ │ │ ├── UserDeletionMapper.java │ │ │ │ ├── UserMailMapper.java │ │ │ │ ├── UserMapper.java │ │ │ │ ├── UserPhoneMapper.java │ │ │ │ └── UserReuseMapper.java │ │ │ ├── dto │ │ │ ├── req │ │ │ │ ├── PassengerRemoveReqDTO.java │ │ │ │ ├── PassengerReqDTO.java │ │ │ │ ├── UserDeletionReqDTO.java │ │ │ │ ├── UserLoginReqDTO.java │ │ │ │ ├── UserRegisterReqDTO.java │ │ │ │ └── UserUpdateReqDTO.java │ │ │ └── resp │ │ │ │ ├── PassengerActualRespDTO.java │ │ │ │ ├── PassengerRespDTO.java │ │ │ │ ├── UserLoginRespDTO.java │ │ │ │ ├── UserQueryActualRespDTO.java │ │ │ │ ├── UserQueryRespDTO.java │ │ │ │ └── UserRegisterRespDTO.java │ │ │ ├── serialize │ │ │ ├── IdCardDesensitizationSerializer.java │ │ │ └── PhoneDesensitizationSerializer.java │ │ │ ├── service │ │ │ ├── PassengerService.java │ │ │ ├── UserLoginService.java │ │ │ ├── UserService.java │ │ │ ├── handler │ │ │ │ └── filter │ │ │ │ │ └── user │ │ │ │ │ ├── UserRegisterCheckDeletionChainHandler.java │ │ │ │ │ ├── UserRegisterCreateChainFilter.java │ │ │ │ │ ├── UserRegisterHasUsernameChainHandler.java │ │ │ │ │ └── UserRegisterParamNotNullChainHandler.java │ │ │ └── impl │ │ │ │ ├── PassengerServiceImpl.java │ │ │ │ ├── UserLoginServiceImpl.java │ │ │ │ └── UserServiceImpl.java │ │ │ └── toolkit │ │ │ └── UserReuseUtil.java │ └── resources │ │ ├── application.yaml │ │ ├── mapper │ │ ├── UserMailMapper.xml │ │ ├── UserMapper.xml │ │ └── UserPhoneMapper.xml │ │ └── shardingsphere-config.yaml │ └── test │ └── java │ └── org │ └── opengoofy │ └── index12306 │ └── biz │ └── userservice │ └── UserServiceApplicationTests.java └── tests ├── general ├── pom.xml └── src │ └── test │ └── java │ └── org │ └── opengoofy │ └── index12306 │ └── test │ └── general │ └── GeneralTests.java └── pom.xml /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | !**/src/main/**/target/ 4 | !**/src/test/**/target/ 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | !/.idea/icon.png 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /.idea/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nageoffer/12306/7b0a0ddd479604c2512a6d31509e9f7848a3b51e/.idea/icon.png -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nageoffer/12306/7b0a0ddd479604c2512a6d31509e9f7848a3b51e/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /checkstyle/12306_checkstyle_suppression.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /console-vue/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not dead 4 | not ie 11 5 | -------------------------------------------------------------------------------- /console-vue/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /console-vue/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 80, 3 | "tabWidth": 2, 4 | "useTabs": false, 5 | "singleQuote": true, 6 | "semi": false, 7 | "trailingComma": "none", 8 | "bracketSpacing": true 9 | } 10 | -------------------------------------------------------------------------------- /console-vue/README.md: -------------------------------------------------------------------------------- 1 | # console-vue 2 | 3 | ## Project setup 4 | ``` 5 | yarn install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | yarn serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | yarn build 16 | ``` 17 | 18 | ### Customize configuration 19 | See [Configuration Reference](https://cli.vuejs.org/config/). 20 | -------------------------------------------------------------------------------- /console-vue/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /console-vue/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "esnext", 5 | "baseUrl": "./", 6 | "moduleResolution": "node", 7 | "paths": { 8 | "@/*": [ 9 | "src/*" 10 | ] 11 | }, 12 | "lib": [ 13 | "esnext", 14 | "dom", 15 | "dom.iterable", 16 | "scripthost" 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /console-vue/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "console-vue", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build" 8 | }, 9 | "dependencies": { 10 | "@ant-design/icons-vue": "^6.1.0", 11 | "@ethafeng/utils-library": "^1.1.2", 12 | "ant-design-vue": "^3.2.20", 13 | "axios": "^1.4.0", 14 | "core-js": "^3.8.3", 15 | "dayjs": "^1.11.8", 16 | "js-cookie": "^3.0.5", 17 | "less-loader": "5", 18 | "moment": "^2.29.4", 19 | "vue": "^3.2.13", 20 | "vue-avatar": "^2.3.3", 21 | "vue-router": "^4.0.3" 22 | }, 23 | "devDependencies": { 24 | "@vue/cli-plugin-babel": "~5.0.0", 25 | "@vue/cli-plugin-router": "~5.0.0", 26 | "@vue/cli-service": "~5.0.0", 27 | "less": "^4.1.3", 28 | "mockjs": "^1.1.0", 29 | "sass": "^1.62.1", 30 | "sass-loader": "^13.3.1" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /console-vue/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nageoffer/12306/7b0a0ddd479604c2512a6d31509e9f7848a3b51e/console-vue/public/favicon.ico -------------------------------------------------------------------------------- /console-vue/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 拿个offer-12306铁路购票 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /console-vue/src/assets/black_dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nageoffer/12306/7b0a0ddd479604c2512a6d31509e9f7848a3b51e/console-vue/src/assets/black_dot.png -------------------------------------------------------------------------------- /console-vue/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nageoffer/12306/7b0a0ddd479604c2512a6d31509e9f7848a3b51e/console-vue/src/assets/logo.png -------------------------------------------------------------------------------- /console-vue/src/components/bread-header/index.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 33 | 34 | 41 | -------------------------------------------------------------------------------- /console-vue/src/components/icon-font/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /console-vue/src/global.less: -------------------------------------------------------------------------------- 1 | .ant-card-bordered { 2 | border: 1px solid #1890ff; 3 | } 4 | .ant-card-head { 5 | background-color: #1e71bd; 6 | .ant-card-head-title { 7 | color: #fff; 8 | } 9 | } 10 | .ant-table-thead { 11 | .ant-table-cell { 12 | background: url(https://kyfw.12306.cn/otn/resources/images/bg_tlisthd.png) 13 | top repeat-x; 14 | background-size: cover; 15 | } 16 | } 17 | .ant-modal-header { 18 | background-color: #1e71bd; 19 | .ant-modal-title { 20 | color: #fff; 21 | } 22 | } 23 | 24 | .amount { 25 | color: rgb(254, 154, 94); 26 | &::before { 27 | content: '¥'; 28 | color: rgb(254, 154, 94); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /console-vue/src/main.js: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | import Antd from 'ant-design-vue' 5 | import 'ant-design-vue/dist/antd.less' 6 | import './global.less' 7 | import dayjs from 'dayjs' 8 | import 'dayjs/locale/zh-cn' 9 | dayjs.locale('zh-cn') 10 | 11 | const app = createApp(App) 12 | app.use(router).use(Antd).mount('#app') 13 | -------------------------------------------------------------------------------- /console-vue/src/mock/index.js: -------------------------------------------------------------------------------- 1 | import Mock from 'mockjs' 2 | //使用mockjs模拟数据 3 | Mock.mock('/api/login', 'get', () => { 4 | return { 5 | status: 10000, 6 | data: null, 7 | msg: '登录成功' 8 | } 9 | }) 10 | -------------------------------------------------------------------------------- /console-vue/src/service/axios.js: -------------------------------------------------------------------------------- 1 | import { message } from 'ant-design-vue' 2 | import Axios from 'axios' 3 | import Cookie from 'js-cookie' 4 | 5 | if (Cookie.get('token')) { 6 | } 7 | 8 | const initAxios = Axios.create({ 9 | timeout: 1800000 //数据响应过期时间 10 | // baseURL: 'http://12306-rd.magestack.cn:9000' 11 | // headers: ['Authorization', Cookie.get('token') ?? null] 12 | }) 13 | 14 | //请求拦截器 15 | initAxios.interceptors.request.use( 16 | (config) => { 17 | //在发送之前做点什么 18 | return config 19 | }, 20 | (error) => { 21 | //对请求错误做点什么 22 | return error 23 | } 24 | ) 25 | 26 | //响应拦截器 27 | initAxios.interceptors.response.use( 28 | (response) => { 29 | if (response.code === 401) { 30 | message.error('用户未登录或已过期!') 31 | // location.href = '/login' 32 | window.location.href = 'login' 33 | } 34 | return response 35 | }, 36 | (error) => { 37 | console.log(error, 'error') 38 | if (error.response.status === 401) { 39 | message.error('用户未登录或已过期!') 40 | window.location.href = 'login' 41 | } 42 | return Promise.reject(error) 43 | } 44 | ) 45 | 46 | // const http = Axios() 47 | 48 | export default initAxios 49 | -------------------------------------------------------------------------------- /console-vue/src/utils/index.js: -------------------------------------------------------------------------------- 1 | const getWeekNumber = (number) => { 2 | switch (number) { 3 | case 0: 4 | return '周天' 5 | case 1: 6 | return '周一' 7 | case 2: 8 | return '周二' 9 | case 3: 10 | return '周三' 11 | case 4: 12 | return '周四' 13 | case 5: 14 | return '周五' 15 | case 6: 16 | return '周六' 17 | } 18 | } 19 | 20 | const getTicketNumber = (number) => { 21 | if (number && number > 20) { 22 | return { 23 | color: 'green', 24 | label: '有' 25 | } 26 | } else if (number && number < 20) { 27 | return { 28 | color: 'black', 29 | label: number 30 | } 31 | } else if (number === 0) { 32 | return { 33 | color: 'gray', 34 | label: '无' 35 | } 36 | } else { 37 | return { 38 | color: 'gray' 39 | } 40 | } 41 | } 42 | 43 | export { getWeekNumber, getTicketNumber } 44 | -------------------------------------------------------------------------------- /console-vue/src/views/ali-pay/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /console-vue/src/views/my-ticket/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /console-vue/src/views/order-list/components/edit-content/index.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 17 | 18 | 22 | -------------------------------------------------------------------------------- /console-vue/src/views/order-list/components/refund-ticket/index.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 20 | 21 | 34 | -------------------------------------------------------------------------------- /console-vue/src/views/order-list/components/show-card-info/index.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 28 | 29 | 42 | -------------------------------------------------------------------------------- /console-vue/vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | devServer: { 3 | proxy: { 4 | '/api': { 5 | target: 'http://127.0.0.1:9000', 6 | changeOrigin: true, 7 | ws: true 8 | } 9 | } 10 | }, 11 | css: { 12 | loaderOptions: { 13 | less: { 14 | javascriptEnabled: true, 15 | modifyVars: { 16 | 'border-radius-base': '4px', 17 | 'card-radius': '4px' 18 | } 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /format/copyright.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | -------------------------------------------------------------------------------- /frameworks/base/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.opengoofy.index12306 7 | index12306-frameworks 8 | 0.0.1-SNAPSHOT 9 | 10 | 11 | index12306-base-spring-boot-starter 12 | 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /frameworks/base/src/main/java/org/opengoofy/index12306/framework/starter/bases/constant/FilterOrderConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.bases.constant; 19 | 20 | /** 21 | * 全局过滤器顺序执行常量类 22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 23 | */ 24 | public final class FilterOrderConstant { 25 | 26 | /** 27 | * 用户信息传递过滤器执行顺序排序 28 | */ 29 | public static final int USER_TRANSMIT_FILTER_ORDER = 100; 30 | } 31 | -------------------------------------------------------------------------------- /frameworks/base/src/main/java/org/opengoofy/index12306/framework/starter/bases/constant/UserConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.bases.constant; 19 | 20 | /** 21 | * 用户常量 22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 23 | */ 24 | public final class UserConstant { 25 | 26 | /** 27 | * 用户 ID Key 28 | */ 29 | public static final String USER_ID_KEY = "userId"; 30 | 31 | /** 32 | * 用户名 Key 33 | */ 34 | public static final String USER_NAME_KEY = "username"; 35 | 36 | /** 37 | * 用户真实名称 Key 38 | */ 39 | public static final String REAL_NAME_KEY = "realName"; 40 | 41 | /** 42 | * 用户 Token Key 43 | */ 44 | public static final String USER_TOKEN_KEY = "token"; 45 | } 46 | -------------------------------------------------------------------------------- /frameworks/base/src/main/java/org/opengoofy/index12306/framework/starter/bases/init/ApplicationInitializingEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.bases.init; 19 | 20 | import org.springframework.context.ApplicationEvent; 21 | 22 | /** 23 | * 应用初始化事件 24 | * 25 | *

规约事件,通过此事件可以查看业务系统所有初始化行为 26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 27 | */ 28 | public class ApplicationInitializingEvent extends ApplicationEvent { 29 | 30 | /** 31 | * Create a new {@code ApplicationEvent}. 32 | * 33 | * @param source the object on which the event initially occurred or with 34 | * which the event is associated (never {@code null}) 35 | */ 36 | public ApplicationInitializingEvent(Object source) { 37 | super(source); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /frameworks/base/src/main/java/org/opengoofy/index12306/framework/starter/bases/safa/FastJsonSafeMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.bases.safa; 19 | 20 | import org.springframework.beans.factory.InitializingBean; 21 | 22 | /** 23 | * FastJson安全模式,开启后关闭类型隐式传递 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | public class FastJsonSafeMode implements InitializingBean { 27 | 28 | @Override 29 | public void afterPropertiesSet() throws Exception { 30 | System.setProperty("fastjson2.parser.safeMode", "true"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /frameworks/base/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | org.opengoofy.index12306.framework.starter.bases.config.ApplicationBaseAutoConfiguration 19 | -------------------------------------------------------------------------------- /frameworks/bizs/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.opengoofy.index12306 7 | index12306-frameworks 8 | 0.0.1-SNAPSHOT 9 | 10 | index12306-bizs-spring-boot-starter 11 | pom 12 | 13 | 14 | user 15 | 16 | 17 | -------------------------------------------------------------------------------- /frameworks/bizs/user/src/main/java/org/opengoofy/index12306/frameworks/starter/user/core/UserInfoDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.frameworks.starter.user.core; 19 | 20 | import lombok.AllArgsConstructor; 21 | import lombok.Builder; 22 | import lombok.Data; 23 | import lombok.NoArgsConstructor; 24 | 25 | /** 26 | * 用户信息实体 27 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 28 | */ 29 | @Data 30 | @NoArgsConstructor 31 | @AllArgsConstructor 32 | @Builder 33 | public class UserInfoDTO { 34 | 35 | /** 36 | * 用户 ID 37 | */ 38 | private String userId; 39 | 40 | /** 41 | * 用户名 42 | */ 43 | private String username; 44 | 45 | /** 46 | * 真实姓名 47 | */ 48 | private String realName; 49 | 50 | /** 51 | * 用户 Token 52 | */ 53 | private String token; 54 | } 55 | -------------------------------------------------------------------------------- /frameworks/bizs/user/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | org.opengoofy.index12306.frameworks.starter.user.config.UserAutoConfiguration 19 | -------------------------------------------------------------------------------- /frameworks/cache/src/main/java/org/opengoofy/index12306/framework/starter/cache/MultistageCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.cache; 19 | 20 | /** 21 | * 多级缓存 22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 23 | */ 24 | public interface MultistageCache extends Cache { 25 | } 26 | -------------------------------------------------------------------------------- /frameworks/cache/src/main/java/org/opengoofy/index12306/framework/starter/cache/core/CacheGetFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.cache.core; 19 | 20 | /** 21 | * 缓存过滤 22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 23 | */ 24 | @FunctionalInterface 25 | public interface CacheGetFilter { 26 | 27 | /** 28 | * 缓存过滤 29 | * 30 | * @param param 输出参数 31 | * @return {@code true} 如果输入参数匹配,否则 {@link Boolean#TRUE} 32 | */ 33 | boolean filter(T param); 34 | } 35 | -------------------------------------------------------------------------------- /frameworks/cache/src/main/java/org/opengoofy/index12306/framework/starter/cache/core/CacheGetIfAbsent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.cache.core; 19 | 20 | /** 21 | * 缓存查询为空 22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 23 | */ 24 | @FunctionalInterface 25 | public interface CacheGetIfAbsent { 26 | 27 | /** 28 | * 如果查询结果为空,执行逻辑 29 | */ 30 | void execute(T param); 31 | } 32 | -------------------------------------------------------------------------------- /frameworks/cache/src/main/java/org/opengoofy/index12306/framework/starter/cache/core/CacheLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.cache.core; 19 | 20 | /** 21 | * 缓存加载器 22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 23 | */ 24 | @FunctionalInterface 25 | public interface CacheLoader { 26 | 27 | /** 28 | * 加载缓存 29 | */ 30 | T load(); 31 | } 32 | -------------------------------------------------------------------------------- /frameworks/cache/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | org.opengoofy.index12306.framework.starter.cache.config.CacheAutoConfiguration 19 | -------------------------------------------------------------------------------- /frameworks/cache/src/main/resources/lua/putIfAllAbsent.lua: -------------------------------------------------------------------------------- 1 | --[[KEYS 全部不存在,创建并返回 true,反之返回空]] 2 | 3 | for i, v in ipairs(KEYS) do 4 | if (redis.call('exists', v) == 1) then 5 | return nil; 6 | end 7 | end 8 | for i, v in ipairs(KEYS) do 9 | redis.call('set', v, 'default'); 10 | redis.call('pexpire', v, ARGV[1]); 11 | end 12 | return true; 13 | -------------------------------------------------------------------------------- /frameworks/common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.opengoofy.index12306 7 | index12306-frameworks 8 | 0.0.1-SNAPSHOT 9 | 10 | 11 | index12306-common-spring-boot-starter 12 | 13 | 14 | 15 | org.opengoofy.index12306 16 | index12306-base-spring-boot-starter 17 | ${project.version} 18 | 19 | 20 | 21 | com.github.dozermapper 22 | dozer-core 23 | 24 | 25 | 26 | org.opengoofy.index12306 27 | index12306-designpattern-spring-boot-starter 28 | ${project.version} 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /frameworks/common/src/main/java/org/opengoofy/index12306/framework/starter/common/enums/OperationTypeEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.common.enums; 19 | 20 | /** 21 | * 操作类型 22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 23 | */ 24 | public enum OperationTypeEnum { 25 | 26 | SAVE, 27 | 28 | UPDATE, 29 | 30 | DELETE 31 | } 32 | -------------------------------------------------------------------------------- /frameworks/common/src/main/java/org/opengoofy/index12306/framework/starter/common/toolkit/ThreadUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.common.toolkit; 19 | 20 | import lombok.SneakyThrows; 21 | 22 | /** 23 | * 线程池工具类 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | public final class ThreadUtil { 27 | 28 | /** 29 | * 睡眠当前线程指定时间 {@param millis} 30 | * 31 | * @param millis 睡眠时间,单位毫秒 32 | */ 33 | @SneakyThrows(value = InterruptedException.class) 34 | public static void sleep(long millis) { 35 | Thread.sleep(millis); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /frameworks/convention/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.opengoofy.index12306 7 | index12306-frameworks 8 | 0.0.1-SNAPSHOT 9 | 10 | 11 | index12306-convention-spring-boot-starter 12 | 13 | -------------------------------------------------------------------------------- /frameworks/convention/src/main/java/org/opengoofy/index12306/framework/starter/convention/errorcode/IErrorCode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.convention.errorcode; 19 | 20 | /** 21 | * 平台错误码 22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 23 | */ 24 | public interface IErrorCode { 25 | 26 | /** 27 | * 错误码 28 | */ 29 | String code(); 30 | 31 | /** 32 | * 错误信息 33 | */ 34 | String message(); 35 | } 36 | -------------------------------------------------------------------------------- /frameworks/convention/src/main/java/org/opengoofy/index12306/framework/starter/convention/page/PageRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.convention.page; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 分页请求对象 24 | * 25 | *

{@link PageRequest}、{@link PageResponse} 26 | * 可以理解是防腐层的一种实现,不论底层 ORM 框架,对外分页参数属性不变 27 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 28 | */ 29 | @Data 30 | public class PageRequest { 31 | 32 | /** 33 | * 当前页 34 | */ 35 | private Long current = 1L; 36 | 37 | /** 38 | * 每页显示条数 39 | */ 40 | private Long size = 10L; 41 | } 42 | -------------------------------------------------------------------------------- /frameworks/database/src/main/java/org/opengoofy/index12306/framework/starter/database/handler/CustomIdGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.database.handler; 19 | 20 | import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator; 21 | import org.opengoofy.index12306.framework.starter.distributedid.toolkit.SnowflakeIdUtil; 22 | 23 | /** 24 | * 自定义雪花算法生成器 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public class CustomIdGenerator implements IdentifierGenerator { 28 | 29 | @Override 30 | public Number nextId(Object entity) { 31 | return SnowflakeIdUtil.nextId(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /frameworks/database/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | org.opengoofy.index12306.framework.starter.database.config.MybatisPlusAutoConfiguration 19 | -------------------------------------------------------------------------------- /frameworks/designpattern/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.opengoofy.index12306 7 | index12306-frameworks 8 | 0.0.1-SNAPSHOT 9 | 10 | 11 | index12306-designpattern-spring-boot-starter 12 | 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter 17 | 18 | 19 | 20 | org.opengoofy.index12306 21 | index12306-base-spring-boot-starter 22 | ${project.version} 23 | 24 | 25 | 26 | org.opengoofy.index12306 27 | index12306-convention-spring-boot-starter 28 | ${project.version} 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /frameworks/designpattern/src/main/java/org/opengoofy/index12306/framework/starter/designpattern/builder/Builder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.designpattern.builder; 19 | 20 | import java.io.Serializable; 21 | 22 | /** 23 | * Builder 模式抽象接口 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | public interface Builder extends Serializable { 27 | 28 | /** 29 | * 构建方法 30 | * 31 | * @return 构建后的对象 32 | */ 33 | T build(); 34 | } 35 | -------------------------------------------------------------------------------- /frameworks/designpattern/src/main/java/org/opengoofy/index12306/framework/starter/designpattern/chain/AbstractChainHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.designpattern.chain; 19 | 20 | import org.springframework.core.Ordered; 21 | 22 | /** 23 | * 抽象业务责任链组件 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | public interface AbstractChainHandler extends Ordered { 27 | 28 | /** 29 | * 执行责任链逻辑 30 | * 31 | * @param requestParam 责任链执行入参 32 | */ 33 | void handler(T requestParam); 34 | 35 | /** 36 | * @return 责任链组件标识 37 | */ 38 | String mark(); 39 | } 40 | -------------------------------------------------------------------------------- /frameworks/designpattern/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | org.opengoofy.index12306.framework.starter.designpattern.config.DesignPatternAutoConfiguration 19 | -------------------------------------------------------------------------------- /frameworks/distributedid/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.opengoofy.index12306 7 | index12306-frameworks 8 | 0.0.1-SNAPSHOT 9 | 10 | 11 | index12306-distributedid-spring-boot-starter 12 | 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-data-redis 17 | true 18 | 19 | 20 | 21 | org.opengoofy.index12306 22 | index12306-base-spring-boot-starter 23 | ${project.version} 24 | 25 | 26 | 27 | cn.hutool 28 | hutool-all 29 | 30 | 31 | 32 | org.springframework.boot 33 | spring-boot-starter-test 34 | test 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /frameworks/distributedid/src/main/java/org/opengoofy/index12306/framework/starter/distributedid/core/IdGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.distributedid.core; 19 | 20 | /** 21 | * ID 生成器 22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 23 | */ 24 | public interface IdGenerator { 25 | 26 | /** 27 | * 下一个 ID 28 | */ 29 | default long nextId() { 30 | return 0L; 31 | } 32 | 33 | /** 34 | * 下一个 ID 字符串 35 | */ 36 | default String nextIdStr() { 37 | return ""; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /frameworks/distributedid/src/main/java/org/opengoofy/index12306/framework/starter/distributedid/core/snowflake/WorkIdWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.distributedid.core.snowflake; 19 | 20 | import lombok.AllArgsConstructor; 21 | import lombok.Data; 22 | import lombok.NoArgsConstructor; 23 | 24 | /** 25 | * WorkId 包装器 26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 27 | */ 28 | @Data 29 | @NoArgsConstructor 30 | @AllArgsConstructor 31 | public class WorkIdWrapper { 32 | 33 | /** 34 | * 工作ID 35 | */ 36 | private Long workId; 37 | 38 | /** 39 | * 数据中心ID 40 | */ 41 | private Long dataCenterId; 42 | } 43 | -------------------------------------------------------------------------------- /frameworks/distributedid/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | org.opengoofy.index12306.framework.starter.distributedid.config.DistributedIdAutoConfiguration 19 | -------------------------------------------------------------------------------- /frameworks/distributedid/src/main/resources/lua/chooseWorkIdLua.lua: -------------------------------------------------------------------------------- 1 | local hashKey = 'snowflake_work_id_key' 2 | local dataCenterIdKey = 'dataCenterId' 3 | local workIdKey = 'workId' 4 | 5 | if (redis.call('exists', hashKey) == 0) then 6 | redis.call('hincrby', hashKey, dataCenterIdKey, 0) 7 | redis.call('hincrby', hashKey, workIdKey, 0) 8 | return { 0, 0 } 9 | end 10 | 11 | local dataCenterId = tonumber(redis.call('hget', hashKey, dataCenterIdKey)) 12 | local workId = tonumber(redis.call('hget', hashKey, workIdKey)) 13 | 14 | local max = 31 15 | local resultWorkId = 0 16 | local resultDataCenterId = 0 17 | 18 | if (dataCenterId == max and workId == max) then 19 | redis.call('hset', hashKey, dataCenterIdKey, '0') 20 | redis.call('hset', hashKey, workIdKey, '0') 21 | 22 | elseif (workId ~= max) then 23 | resultWorkId = redis.call('hincrby', hashKey, workIdKey, 1) 24 | resultDataCenterId = dataCenterId 25 | 26 | elseif (dataCenterId ~= max) then 27 | resultWorkId = 0 28 | resultDataCenterId = redis.call('hincrby', hashKey, dataCenterIdKey, 1) 29 | redis.call('hset', hashKey, workIdKey, '0') 30 | 31 | end 32 | 33 | return { resultWorkId, resultDataCenterId } 34 | -------------------------------------------------------------------------------- /frameworks/idempotent/src/main/java/org/opengoofy/index12306/framework/starter/idempotent/core/RepeatConsumptionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.idempotent.core; 19 | 20 | import lombok.Getter; 21 | import lombok.RequiredArgsConstructor; 22 | 23 | /** 24 | * 重复消费异常 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | @RequiredArgsConstructor 28 | public class RepeatConsumptionException extends RuntimeException { 29 | 30 | /** 31 | * 错误标识 32 | *

33 | * 触发幂等逻辑时可能有两种情况: 34 | * 1. 消息还在处理,但是不确定是否执行成功,那么需要返回错误,方便 RocketMQ 再次通过重试队列投递 35 | * 2. 消息处理成功了,该消息直接返回成功即可 36 | */ 37 | @Getter 38 | private final Boolean error; 39 | } 40 | -------------------------------------------------------------------------------- /frameworks/idempotent/src/main/java/org/opengoofy/index12306/framework/starter/idempotent/core/param/IdempotentParamService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.idempotent.core.param; 19 | 20 | import org.opengoofy.index12306.framework.starter.idempotent.core.IdempotentExecuteHandler; 21 | 22 | /** 23 | * 参数方式幂等实现接口 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | public interface IdempotentParamService extends IdempotentExecuteHandler { 27 | } 28 | -------------------------------------------------------------------------------- /frameworks/idempotent/src/main/java/org/opengoofy/index12306/framework/starter/idempotent/core/spel/IdempotentSpELService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.idempotent.core.spel; 19 | 20 | import org.opengoofy.index12306.framework.starter.idempotent.core.IdempotentExecuteHandler; 21 | 22 | /** 23 | * SpEL 方式幂等实现接口 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | public interface IdempotentSpELService extends IdempotentExecuteHandler { 27 | } 28 | -------------------------------------------------------------------------------- /frameworks/idempotent/src/main/java/org/opengoofy/index12306/framework/starter/idempotent/core/token/IdempotentTokenService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.idempotent.core.token; 19 | 20 | import org.opengoofy.index12306.framework.starter.idempotent.core.IdempotentExecuteHandler; 21 | 22 | /** 23 | * Token 实现幂等接口 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | public interface IdempotentTokenService extends IdempotentExecuteHandler { 27 | 28 | /** 29 | * 创建幂等验证Token 30 | */ 31 | String createToken(); 32 | } 33 | -------------------------------------------------------------------------------- /frameworks/idempotent/src/main/java/org/opengoofy/index12306/framework/starter/idempotent/enums/IdempotentSceneEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.idempotent.enums; 19 | 20 | /** 21 | * 幂等验证场景枚举 22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 23 | */ 24 | public enum IdempotentSceneEnum { 25 | 26 | /** 27 | * 基于 RestAPI 场景验证 28 | */ 29 | RESTAPI, 30 | 31 | /** 32 | * 基于 MQ 场景验证 33 | */ 34 | MQ 35 | } 36 | -------------------------------------------------------------------------------- /frameworks/idempotent/src/main/java/org/opengoofy/index12306/framework/starter/idempotent/enums/IdempotentTypeEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.idempotent.enums; 19 | 20 | /** 21 | * 幂等验证类型枚举 22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 23 | */ 24 | public enum IdempotentTypeEnum { 25 | 26 | /** 27 | * 基于 Token 方式验证 28 | */ 29 | TOKEN, 30 | 31 | /** 32 | * 基于方法参数方式验证 33 | */ 34 | PARAM, 35 | 36 | /** 37 | * 基于 SpEL 表达式方式验证 38 | */ 39 | SPEL 40 | } 41 | -------------------------------------------------------------------------------- /frameworks/idempotent/src/main/java/org/opengoofy/index12306/framework/starter/idempotent/toolkit/LogUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.idempotent.toolkit; 19 | 20 | import org.aspectj.lang.ProceedingJoinPoint; 21 | import org.aspectj.lang.reflect.MethodSignature; 22 | import org.slf4j.Logger; 23 | import org.slf4j.LoggerFactory; 24 | 25 | /** 26 | * 日志工具类 27 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 28 | */ 29 | public class LogUtil { 30 | 31 | /** 32 | * 获取 Logger 33 | */ 34 | public static Logger getLog(ProceedingJoinPoint joinPoint) { 35 | MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature(); 36 | return LoggerFactory.getLogger(methodSignature.getDeclaringType()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /frameworks/idempotent/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | org.opengoofy.index12306.framework.starter.idempotent.config.IdempotentAutoConfiguration 19 | -------------------------------------------------------------------------------- /frameworks/idempotent/src/main/resources/lua/set_if_absent_and_get.lua: -------------------------------------------------------------------------------- 1 | -- 原子性获取给定key,若key存在返回其值,若key不存在则设置key并返回null 2 | local key = KEYS[1] 3 | local value = ARGV[1] 4 | local expire_time_ms = ARGV[2] 5 | 6 | return redis.call('SET', key, value, 'NX', 'GET', 'PX', expire_time_ms) 7 | -------------------------------------------------------------------------------- /frameworks/log/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.opengoofy.index12306 7 | index12306-frameworks 8 | 0.0.1-SNAPSHOT 9 | 10 | index12306-log-spring-boot-starter 11 | 12 | 13 | 14 | org.springframework.boot 15 | spring-boot-starter 16 | 17 | 18 | 19 | com.alibaba.fastjson2 20 | fastjson2 21 | 22 | 23 | 24 | org.aspectj 25 | aspectjweaver 26 | 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-web 31 | true 32 | 33 | 34 | 35 | cn.hutool 36 | hutool-all 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /frameworks/log/src/main/java/org/opengoofy/index12306/framework/starter/log/config/LogAutoConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.log.config; 19 | 20 | import org.opengoofy.index12306.framework.starter.log.core.ILogPrintAspect; 21 | import org.opengoofy.index12306.framework.starter.log.annotation.ILog; 22 | import org.springframework.context.annotation.Bean; 23 | 24 | /** 25 | * 日志自动装配 26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 27 | */ 28 | public class LogAutoConfiguration { 29 | 30 | /** 31 | * {@link ILog} 日志打印 AOP 切面 32 | */ 33 | @Bean 34 | public ILogPrintAspect iLogPrintAspect() { 35 | return new ILogPrintAspect(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /frameworks/log/src/main/java/org/opengoofy/index12306/framework/starter/log/core/ILogPrintDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.framework.starter.log.core; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * ILog 日志打印实体 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | @Data 27 | public class ILogPrintDTO { 28 | 29 | /** 30 | * 开始时间 31 | */ 32 | private String beginTime; 33 | 34 | /** 35 | * 请求入参 36 | */ 37 | private Object[] inputParams; 38 | 39 | /** 40 | * 返回参数 41 | */ 42 | private Object outputParams; 43 | } 44 | -------------------------------------------------------------------------------- /frameworks/log/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | org.opengoofy.index12306.framework.starter.log.config.LogAutoConfiguration 19 | -------------------------------------------------------------------------------- /frameworks/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.opengoofy.index12306 7 | index12306-all 8 | 0.0.1-SNAPSHOT 9 | 10 | 11 | index12306-frameworks 12 | pom 13 | 14 | 15 | base 16 | bizs 17 | cache 18 | common 19 | convention 20 | database 21 | designpattern 22 | distributedid 23 | idempotent 24 | log 25 | web 26 | 27 | 28 | -------------------------------------------------------------------------------- /frameworks/web/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.opengoofy.index12306 7 | index12306-frameworks 8 | 0.0.1-SNAPSHOT 9 | 10 | 11 | index12306-web-spring-boot-starter 12 | 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter 17 | 18 | 19 | 20 | org.opengoofy.index12306 21 | index12306-convention-spring-boot-starter 22 | ${project.version} 23 | 24 | 25 | 26 | org.springframework.boot 27 | spring-boot-starter-web 28 | 29 | 30 | 31 | cn.hutool 32 | hutool-all 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /frameworks/web/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | org.opengoofy.index12306.framework.starter.web.config.WebAutoConfiguration 19 | -------------------------------------------------------------------------------- /lombok.config: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # this config is to ignore lombok code in jacoco 19 | config.stopBubbling = true 20 | lombok.addLombokGeneratedAnnotation = true 21 | 22 | # fix @Data callSuper=false 23 | lombok.equalsAndHashCode.callSuper = skip 24 | -------------------------------------------------------------------------------- /services/aggregation-service/src/main/java/org/opengoofy/index12306/biz/aggregationservice/config/DemoModeProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.aggregationservice.config; 19 | 20 | import lombok.Data; 21 | import org.springframework.boot.context.properties.ConfigurationProperties; 22 | import org.springframework.stereotype.Component; 23 | 24 | import java.util.List; 25 | 26 | /** 27 | * 演示环境配置属性 28 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 29 | */ 30 | @Data 31 | @Component 32 | @ConfigurationProperties(prefix = "aggregation.demo-mode") 33 | public class DemoModeProperties { 34 | 35 | /** 36 | * 是否开启演示环境模式 37 | */ 38 | private Boolean enable; 39 | 40 | /** 41 | * 演示环境黑名单路径 42 | */ 43 | private List blacklist; 44 | } 45 | -------------------------------------------------------------------------------- /services/gateway-service/src/main/java/org/opengoofy/index12306/biz/gatewayservice/GatewayServiceApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.gatewayservice; 19 | 20 | import org.springframework.boot.SpringApplication; 21 | import org.springframework.boot.autoconfigure.SpringBootApplication; 22 | 23 | /** 24 | * 网关服务应用启动器 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | @SpringBootApplication 28 | public class GatewayServiceApplication { 29 | 30 | public static void main(String[] args) { 31 | SpringApplication.run(GatewayServiceApplication.class, args); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /services/gateway-service/src/main/java/org/opengoofy/index12306/biz/gatewayservice/config/Config.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.gatewayservice.config; 19 | 20 | import lombok.Data; 21 | 22 | import java.util.List; 23 | 24 | /** 25 | * 过滤器配置 26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 27 | */ 28 | @Data 29 | public class Config { 30 | 31 | /** 32 | * 黑名单前置路径 33 | */ 34 | private List blackPathPre; 35 | } 36 | -------------------------------------------------------------------------------- /services/gateway-service/src/main/java/org/opengoofy/index12306/biz/gatewayservice/toolkit/UserInfoDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.gatewayservice.toolkit; 19 | 20 | import lombok.AllArgsConstructor; 21 | import lombok.Builder; 22 | import lombok.Data; 23 | import lombok.NoArgsConstructor; 24 | 25 | /** 26 | * 用户信息实体 27 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 28 | */ 29 | @Data 30 | @NoArgsConstructor 31 | @AllArgsConstructor 32 | @Builder 33 | public class UserInfoDTO { 34 | 35 | /** 36 | * 用户 ID 37 | */ 38 | private String userId; 39 | 40 | /** 41 | * 用户名 42 | */ 43 | private String username; 44 | 45 | /** 46 | * 真实姓名 47 | */ 48 | private String realName; 49 | } 50 | -------------------------------------------------------------------------------- /services/gateway-service/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 9000 3 | spring: 4 | application: 5 | name: index12306-gateway${unique-name:}-service 6 | profiles: 7 | active: aggregation 8 | # active: dev 9 | cloud: 10 | nacos: 11 | discovery: 12 | server-addr: 127.0.0.1:8848 13 | 14 | management: 15 | endpoints: 16 | web: 17 | exposure: 18 | include: '*' 19 | metrics: 20 | tags: 21 | application: ${spring.application.name} 22 | -------------------------------------------------------------------------------- /services/gateway-service/src/test/java/org/opengoofy/index12306/biz/gatewayservice/GatewayServiceApplicationTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.gatewayservice; 19 | 20 | import org.junit.jupiter.api.Test; 21 | import org.springframework.boot.test.context.SpringBootTest; 22 | 23 | @SpringBootTest 24 | class GatewayServiceApplicationTests { 25 | 26 | @Test 27 | void contextLoads() { 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /services/order-service/src/main/java/org/opengoofy/index12306/biz/orderservice/common/enums/PayChannelEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.orderservice.common.enums; 19 | 20 | import lombok.Getter; 21 | import lombok.RequiredArgsConstructor; 22 | 23 | import java.util.Arrays; 24 | import java.util.Objects; 25 | 26 | /** 27 | * 支付渠道枚举 28 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 29 | */ 30 | @RequiredArgsConstructor 31 | public enum PayChannelEnum { 32 | 33 | /** 34 | * 支付宝 35 | */ 36 | ALI_PAY(0, "ALI_PAY", "支付宝"); 37 | 38 | @Getter 39 | private final Integer code; 40 | 41 | @Getter 42 | private final String name; 43 | 44 | @Getter 45 | private final String value; 46 | } 47 | -------------------------------------------------------------------------------- /services/order-service/src/main/java/org/opengoofy/index12306/biz/orderservice/common/enums/RefundTypeEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.orderservice.common.enums; 19 | 20 | import lombok.Getter; 21 | import lombok.RequiredArgsConstructor; 22 | 23 | /** 24 | * 退款类型枚举 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | @Getter 28 | @RequiredArgsConstructor 29 | public enum RefundTypeEnum { 30 | 31 | /** 32 | * 部分退款 33 | */ 34 | PARTIAL_REFUND(11, 0, "PARTIAL_REFUND", "部分退款"), 35 | 36 | /** 37 | * 全部退款 38 | */ 39 | FULL_REFUND(12, 1, "FULL_REFUND", "全部退款"); 40 | 41 | private final Integer code; 42 | 43 | private final Integer type; 44 | 45 | private final String name; 46 | 47 | private final String value; 48 | } 49 | -------------------------------------------------------------------------------- /services/order-service/src/main/java/org/opengoofy/index12306/biz/orderservice/dao/mapper/OrderItemMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.orderservice.dao.mapper; 19 | 20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 21 | import org.opengoofy.index12306.biz.orderservice.dao.entity.OrderItemDO; 22 | 23 | /** 24 | * 订单明细持久层 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public interface OrderItemMapper extends BaseMapper { 28 | } 29 | -------------------------------------------------------------------------------- /services/order-service/src/main/java/org/opengoofy/index12306/biz/orderservice/dao/mapper/OrderItemPassengerMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.orderservice.dao.mapper; 19 | 20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 21 | import org.opengoofy.index12306.biz.orderservice.dao.entity.OrderItemPassengerDO; 22 | 23 | /** 24 | * 乘车人订单关系持久层 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public interface OrderItemPassengerMapper extends BaseMapper { 28 | } 29 | -------------------------------------------------------------------------------- /services/order-service/src/main/java/org/opengoofy/index12306/biz/orderservice/dao/mapper/OrderMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.orderservice.dao.mapper; 19 | 20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 21 | import org.opengoofy.index12306.biz.orderservice.dao.entity.OrderDO; 22 | 23 | /** 24 | * 订单持久层 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public interface OrderMapper extends BaseMapper { 28 | } 29 | -------------------------------------------------------------------------------- /services/order-service/src/main/java/org/opengoofy/index12306/biz/orderservice/dto/domain/OrderStatusReversalDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.orderservice.dto.domain; 19 | 20 | import lombok.AllArgsConstructor; 21 | import lombok.Builder; 22 | import lombok.Data; 23 | import lombok.NoArgsConstructor; 24 | 25 | /** 26 | * 订单状态反转实体 27 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 28 | */ 29 | @Data 30 | @Builder 31 | @NoArgsConstructor 32 | @AllArgsConstructor 33 | public final class OrderStatusReversalDTO { 34 | 35 | /** 36 | * 订单号 37 | */ 38 | private String orderSn; 39 | 40 | /** 41 | * 订单反转后状态 42 | */ 43 | private Integer orderStatus; 44 | 45 | /** 46 | * 订单明细反转后状态 47 | */ 48 | private Integer orderItemStatus; 49 | } 50 | -------------------------------------------------------------------------------- /services/order-service/src/main/java/org/opengoofy/index12306/biz/orderservice/dto/req/CancelTicketOrderReqDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.orderservice.dto.req; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 取消车票订单请求入参 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | @Data 27 | public class CancelTicketOrderReqDTO { 28 | 29 | /** 30 | * 订单号 31 | */ 32 | private String orderSn; 33 | } 34 | -------------------------------------------------------------------------------- /services/order-service/src/main/java/org/opengoofy/index12306/biz/orderservice/dto/req/TicketOrderItemQueryReqDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.orderservice.dto.req; 19 | 20 | import lombok.Data; 21 | import java.util.List; 22 | 23 | /** 24 | * 车票子订单查询 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | @Data 28 | public class TicketOrderItemQueryReqDTO { 29 | 30 | /** 31 | * 订单号 32 | */ 33 | private String orderSn; 34 | 35 | /** 36 | * 子订单记录id 37 | */ 38 | private List orderItemRecordIds; 39 | } 40 | -------------------------------------------------------------------------------- /services/order-service/src/main/java/org/opengoofy/index12306/biz/orderservice/dto/req/TicketOrderPageQueryReqDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.orderservice.dto.req; 19 | 20 | import lombok.Data; 21 | import org.opengoofy.index12306.framework.starter.convention.page.PageRequest; 22 | 23 | /** 24 | * 车票订单分页查询 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | @Data 28 | public class TicketOrderPageQueryReqDTO extends PageRequest { 29 | 30 | /** 31 | * 用户唯一标识 32 | */ 33 | private String userId; 34 | 35 | /** 36 | * 状态类型 0:未完成 1:未出行 2:历史订单 37 | */ 38 | private Integer statusType; 39 | } 40 | -------------------------------------------------------------------------------- /services/order-service/src/main/java/org/opengoofy/index12306/biz/orderservice/dto/req/TicketOrderSelfPageQueryReqDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.orderservice.dto.req; 19 | 20 | import lombok.Data; 21 | import org.opengoofy.index12306.framework.starter.convention.page.PageRequest; 22 | 23 | /** 24 | * 本人车票订单分页查询 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | @Data 28 | public class TicketOrderSelfPageQueryReqDTO extends PageRequest { 29 | } 30 | -------------------------------------------------------------------------------- /services/order-service/src/main/java/org/opengoofy/index12306/biz/orderservice/service/OrderPassengerRelationService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.orderservice.service; 19 | 20 | import com.baomidou.mybatisplus.extension.service.IService; 21 | import org.opengoofy.index12306.biz.orderservice.dao.entity.OrderItemPassengerDO; 22 | 23 | /** 24 | * 乘车人订单关系接口层 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public interface OrderPassengerRelationService extends IService { 28 | } 29 | -------------------------------------------------------------------------------- /services/order-service/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | # RocketMQ 2.2.3 version does not adapt to SpringBoot3 2 | org.apache.rocketmq.spring.autoconfigure.RocketMQAutoConfiguration -------------------------------------------------------------------------------- /services/order-service/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 9003 3 | 4 | spring: 5 | application: 6 | name: index12306-order${unique-name:}-service 7 | datasource: 8 | driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver 9 | url: jdbc:shardingsphere:classpath:shardingsphere-config.yaml 10 | cloud: 11 | nacos: 12 | discovery: 13 | server-addr: 127.0.0.1:8848 14 | password: nacos 15 | username: nacos 16 | sentinel: 17 | transport: 18 | dashboard: localhost:8686 19 | port: 8719 20 | data: 21 | redis: 22 | host: 127.0.0.1 23 | port: 6379 24 | password: 123456 25 | 26 | mybatis-plus: 27 | global-config: 28 | db-config: 29 | logic-delete-field: delFlag 30 | logic-delete-value: 1 31 | logic-not-delete-value: 0 32 | configuration: 33 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl 34 | # mapper-locations: classpath:mapper/*.xml 35 | 36 | framework: 37 | fastjson: 38 | safa-mode: true 39 | cache: 40 | redis: 41 | value-timeout: 16 42 | value-time-unit: days 43 | 44 | rocketmq: 45 | name-server: 127.0.0.1:9876 46 | producer: 47 | group: index12306_order${unique-name:}-service_common-message-execute_pg 48 | send-message-timeout: 2000 49 | retry-times-when-send-failed: 1 50 | retry-times-when-send-async-failed: 1 51 | 52 | management: 53 | endpoints: 54 | web: 55 | exposure: 56 | include: '*' 57 | metrics: 58 | tags: 59 | application: ${spring.application.name} 60 | -------------------------------------------------------------------------------- /services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/common/constant/RedisKeyConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.payservice.common.constant; 19 | 20 | /** 21 | * Redis Key 定义常量类 22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 23 | */ 24 | public final class RedisKeyConstant { 25 | 26 | /** 27 | * 订单未支付临时存储信息 28 | */ 29 | public static final String ORDER_PAY_RESULT_INFO = "index12306-pay-service:order_pay_result:"; 30 | } 31 | -------------------------------------------------------------------------------- /services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/common/enums/PayChannelEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.payservice.common.enums; 19 | 20 | import lombok.Getter; 21 | import lombok.RequiredArgsConstructor; 22 | 23 | /** 24 | * 支付渠道枚举 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | @RequiredArgsConstructor 28 | public enum PayChannelEnum { 29 | 30 | /** 31 | * 支付宝 32 | */ 33 | ALI_PAY(0, "ALI_PAY", "支付宝"); 34 | 35 | @Getter 36 | private final Integer code; 37 | 38 | @Getter 39 | private final String name; 40 | 41 | @Getter 42 | private final String value; 43 | } 44 | -------------------------------------------------------------------------------- /services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/common/enums/RefundTypeEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.payservice.common.enums; 19 | 20 | import lombok.Getter; 21 | import lombok.RequiredArgsConstructor; 22 | 23 | /** 24 | * 退款类型枚举 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | @Getter 28 | @RequiredArgsConstructor 29 | public enum RefundTypeEnum { 30 | 31 | /** 32 | * 部分退款 33 | */ 34 | PARTIAL_REFUND(11, 0, "PARTIAL_REFUND", "部分退款"), 35 | 36 | /** 37 | * 全部退款 38 | */ 39 | FULL_REFUND(12, 1, "FULL_REFUND", "全部退款"); 40 | 41 | private final Integer code; 42 | 43 | private final Integer type; 44 | 45 | private final String name; 46 | 47 | private final String value; 48 | } 49 | -------------------------------------------------------------------------------- /services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dao/mapper/PayMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.payservice.dao.mapper; 19 | 20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 21 | import org.opengoofy.index12306.biz.payservice.dao.entity.PayDO; 22 | 23 | /** 24 | * 支付持久层 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public interface PayMapper extends BaseMapper { 28 | } 29 | -------------------------------------------------------------------------------- /services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dao/mapper/RefundMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.payservice.dao.mapper; 19 | 20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 21 | import org.opengoofy.index12306.biz.payservice.dao.entity.RefundDO; 22 | 23 | /** 24 | * 退款记录持久层 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public interface RefundMapper extends BaseMapper { 28 | } 29 | -------------------------------------------------------------------------------- /services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dto/PayCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.payservice.dto; 19 | 20 | import lombok.Data; 21 | import org.opengoofy.index12306.biz.payservice.dto.base.AbstractPayRequest; 22 | 23 | import java.math.BigDecimal; 24 | 25 | /** 26 | * 支付请求命令 27 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 28 | */ 29 | @Data 30 | public final class PayCommand extends AbstractPayRequest { 31 | 32 | /** 33 | * 子订单号 34 | */ 35 | private String outOrderSn; 36 | 37 | /** 38 | * 订单总金额 39 | * 单位为元,精确到小数点后两位,取值范围:[0.01,100000000] 40 | */ 41 | private BigDecimal totalAmount; 42 | 43 | /** 44 | * 订单标题 45 | * 注意:不可使用特殊字符,如 /,=,& 等 46 | */ 47 | private String subject; 48 | } 49 | -------------------------------------------------------------------------------- /services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dto/PayInfoRespDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.payservice.dto; 19 | 20 | import lombok.Data; 21 | 22 | import java.util.Date; 23 | 24 | /** 25 | * 支付单详情信息返回参数 26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 27 | */ 28 | @Data 29 | public class PayInfoRespDTO { 30 | 31 | /** 32 | * 订单号 33 | */ 34 | private String orderSn; 35 | 36 | /** 37 | * 支付总金额 38 | */ 39 | private Integer totalAmount; 40 | 41 | /** 42 | * 支付状态 43 | */ 44 | private Integer status; 45 | 46 | /** 47 | * 支付时间 48 | */ 49 | private Date gmtPayment; 50 | } 51 | -------------------------------------------------------------------------------- /services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dto/PayRespDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.payservice.dto; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 支付返回实体 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | @Data 27 | public final class PayRespDTO { 28 | 29 | /** 30 | * 调用支付返回信息 31 | */ 32 | private String body; 33 | } 34 | -------------------------------------------------------------------------------- /services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dto/RefundCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.payservice.dto; 19 | 20 | import lombok.Data; 21 | import org.opengoofy.index12306.biz.payservice.dto.base.AbstractRefundRequest; 22 | 23 | import java.math.BigDecimal; 24 | 25 | /** 26 | * 退款请求命令 27 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 28 | */ 29 | @Data 30 | public final class RefundCommand extends AbstractRefundRequest { 31 | 32 | /** 33 | * 支付金额 34 | */ 35 | private BigDecimal payAmount; 36 | 37 | /** 38 | * 交易凭证号 39 | */ 40 | private String tradeNo; 41 | } 42 | -------------------------------------------------------------------------------- /services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dto/RefundCreateDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.payservice.dto; 19 | 20 | import lombok.Data; 21 | import org.opengoofy.index12306.biz.payservice.remote.dto.TicketOrderPassengerDetailRespDTO; 22 | 23 | import java.util.List; 24 | 25 | /** 26 | * 退款创建入参数实体 27 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 28 | */ 29 | @Data 30 | public class RefundCreateDTO { 31 | 32 | /** 33 | * 支付流水号 34 | */ 35 | private String paySn; 36 | 37 | /** 38 | * 订单号 39 | */ 40 | private String orderSn; 41 | 42 | /** 43 | * 退款类型 44 | */ 45 | private Integer type; 46 | 47 | /** 48 | * 部分退款车票详情集合 49 | */ 50 | private List refundDetailReqDTOList; 51 | } 52 | -------------------------------------------------------------------------------- /services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dto/RefundRespDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.payservice.dto; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 退款详情返回参数实体 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | @Data 27 | public class RefundRespDTO { 28 | } 29 | -------------------------------------------------------------------------------- /services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dto/base/AbstractPayCallbackRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.payservice.dto.base; 19 | 20 | import lombok.Getter; 21 | import lombok.Setter; 22 | 23 | /** 24 | * 抽象支付回调入参实体 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public abstract class AbstractPayCallbackRequest implements PayCallbackRequest { 28 | 29 | @Getter 30 | @Setter 31 | private String orderRequestId; 32 | 33 | @Override 34 | public AliPayCallbackRequest getAliPayCallBackRequest() { 35 | return null; 36 | } 37 | 38 | @Override 39 | public String buildMark() { 40 | return null; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dto/base/PayCallbackRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.payservice.dto.base; 19 | 20 | /** 21 | * 支付回调请求入参 22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 23 | */ 24 | public interface PayCallbackRequest { 25 | 26 | /** 27 | * 获取阿里支付回调入参 28 | */ 29 | AliPayCallbackRequest getAliPayCallBackRequest(); 30 | 31 | /** 32 | * 构建查找支付回调策略实现类标识 33 | */ 34 | String buildMark(); 35 | } 36 | -------------------------------------------------------------------------------- /services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dto/base/PayResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.payservice.dto.base; 19 | 20 | import lombok.AllArgsConstructor; 21 | import lombok.Builder; 22 | import lombok.Data; 23 | import lombok.NoArgsConstructor; 24 | 25 | /** 26 | * 支付返回 27 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 28 | */ 29 | @Data 30 | @NoArgsConstructor 31 | @AllArgsConstructor 32 | @Builder 33 | public final class PayResponse { 34 | 35 | /** 36 | * 调用支付返回信息 37 | */ 38 | private String body; 39 | } 40 | -------------------------------------------------------------------------------- /services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dto/base/RefundRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.payservice.dto.base; 19 | 20 | import java.math.BigDecimal; 21 | 22 | /** 23 | * 退款入参接口 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | public interface RefundRequest { 27 | 28 | /** 29 | * 获取阿里退款入参 30 | */ 31 | AliRefundRequest getAliRefundRequest(); 32 | 33 | /** 34 | * 获取订单号 35 | */ 36 | String getOrderSn(); 37 | 38 | /** 39 | * 构建查找支付策略实现类标识 40 | */ 41 | String buildMark(); 42 | } 43 | -------------------------------------------------------------------------------- /services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dto/base/RefundResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.payservice.dto.base; 19 | 20 | import lombok.AllArgsConstructor; 21 | import lombok.Builder; 22 | import lombok.Data; 23 | import lombok.NoArgsConstructor; 24 | 25 | /** 26 | * 退款返回 27 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 28 | */ 29 | @Data 30 | @NoArgsConstructor 31 | @AllArgsConstructor 32 | @Builder 33 | public final class RefundResponse { 34 | 35 | /** 36 | * 退款状态 37 | */ 38 | private Integer status; 39 | 40 | /** 41 | * 第三方交易凭证 42 | */ 43 | private String tradeNo; 44 | } 45 | -------------------------------------------------------------------------------- /services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/handler/base/AbstractPayCallbackHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.payservice.handler.base; 19 | 20 | import org.opengoofy.index12306.biz.payservice.dto.base.PayCallbackRequest; 21 | 22 | /** 23 | * 抽象支付回调组件 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | public abstract class AbstractPayCallbackHandler { 27 | 28 | /** 29 | * 支付回调抽象接口 30 | * 31 | * @param payCallbackRequest 支付回调请求参数 32 | */ 33 | public abstract void callback(PayCallbackRequest payCallbackRequest); 34 | } 35 | -------------------------------------------------------------------------------- /services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/handler/base/AbstractPayHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.payservice.handler.base; 19 | 20 | import org.opengoofy.index12306.biz.payservice.dto.base.PayRequest; 21 | import org.opengoofy.index12306.biz.payservice.dto.base.PayResponse; 22 | 23 | /** 24 | * 抽象支付组件 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public abstract class AbstractPayHandler { 28 | 29 | /** 30 | * 支付抽象接口 31 | * 32 | * @param payRequest 支付请求参数 33 | * @return 支付响应参数 34 | */ 35 | public abstract PayResponse pay(PayRequest payRequest); 36 | } 37 | -------------------------------------------------------------------------------- /services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/handler/base/AbstractRefundHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.payservice.handler.base; 19 | 20 | import org.opengoofy.index12306.biz.payservice.dto.base.RefundRequest; 21 | import org.opengoofy.index12306.biz.payservice.dto.base.RefundResponse; 22 | 23 | /** 24 | * 抽象退款组件 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public abstract class AbstractRefundHandler { 28 | 29 | /** 30 | * 支付退款接口 31 | * 32 | * @param payRequest 退款请求参数 33 | * @return 退款响应参数 34 | */ 35 | public abstract RefundResponse refund(RefundRequest payRequest); 36 | } 37 | -------------------------------------------------------------------------------- /services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/service/RefundService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.payservice.service; 19 | import org.opengoofy.index12306.biz.payservice.dto.RefundReqDTO; 20 | import org.opengoofy.index12306.biz.payservice.dto.RefundRespDTO; 21 | 22 | /** 23 | * 退款接口层 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | public interface RefundService { 27 | 28 | /** 29 | * 公共退款接口 30 | * 31 | * @param requestParam 退款请求参数 32 | * @return 退款返回详情 33 | */ 34 | RefundRespDTO commonRefund(RefundReqDTO requestParam); 35 | } 36 | -------------------------------------------------------------------------------- /services/pay-service/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | # RocketMQ 2.2.3 version does not adapt to SpringBoot3 2 | org.apache.rocketmq.spring.autoconfigure.RocketMQAutoConfiguration -------------------------------------------------------------------------------- /services/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.opengoofy.index12306 7 | index12306-all 8 | 0.0.1-SNAPSHOT 9 | 10 | 11 | index12306-services 12 | pom 13 | 14 | 15 | aggregation-service 16 | gateway-service 17 | order-service 18 | pay-service 19 | ticket-service 20 | user-service 21 | 22 | 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-actuator 27 | 28 | 29 | 30 | io.micrometer 31 | micrometer-registry-prometheus 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/common/constant/Index12306Constant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.common.constant; 19 | 20 | /** 21 | * 系统级公共常量 22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 23 | */ 24 | public final class Index12306Constant { 25 | 26 | /** 27 | * 提前买票天数 28 | */ 29 | public static final int ADVANCE_TICKET_DAY = 15; 30 | } 31 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/common/enums/RefundTypeEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.common.enums; 19 | 20 | import lombok.Getter; 21 | import lombok.RequiredArgsConstructor; 22 | 23 | /** 24 | * 退款类型枚举 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | @Getter 28 | @RequiredArgsConstructor 29 | public enum RefundTypeEnum { 30 | 31 | /** 32 | * 部分退款 33 | */ 34 | PARTIAL_REFUND(11, 0, "PARTIAL_REFUND", "部分退款"), 35 | 36 | /** 37 | * 全部退款 38 | */ 39 | FULL_REFUND(12, 1, "FULL_REFUND", "全部退款"); 40 | 41 | private final Integer code; 42 | 43 | private final Integer type; 44 | 45 | private final String name; 46 | 47 | private final String value; 48 | } 49 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/common/enums/SeatStatusEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.common.enums; 19 | 20 | import lombok.Getter; 21 | import lombok.RequiredArgsConstructor; 22 | 23 | /** 24 | * 座位状态枚举 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | @RequiredArgsConstructor 28 | public enum SeatStatusEnum { 29 | 30 | /** 31 | * 可售 32 | */ 33 | AVAILABLE(0), 34 | 35 | /** 36 | * 锁定 37 | */ 38 | LOCKED(1), 39 | 40 | /** 41 | * 已售 42 | */ 43 | SOLD(2); 44 | 45 | @Getter 46 | private final Integer code; 47 | } 48 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/common/enums/SourceEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.common.enums; 19 | 20 | import lombok.Getter; 21 | import lombok.RequiredArgsConstructor; 22 | 23 | /** 24 | * 购票来源 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | @RequiredArgsConstructor 28 | public enum SourceEnum { 29 | 30 | /** 31 | * 互联网购票 32 | */ 33 | INTERNET(0), 34 | 35 | /** 36 | * 线下窗口购票 37 | */ 38 | OFFLINE(1); 39 | 40 | @Getter 41 | private final Integer code; 42 | } 43 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/common/enums/TicketChainMarkEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.common.enums; 19 | 20 | /** 21 | * 购票相关责任链 Mark 枚举 22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 23 | */ 24 | public enum TicketChainMarkEnum { 25 | 26 | /** 27 | * 车票查询过滤器 28 | */ 29 | TRAIN_QUERY_FILTER, 30 | 31 | /** 32 | * 车票购买过滤器 33 | */ 34 | TRAIN_PURCHASE_TICKET_FILTER, 35 | 36 | /** 37 | * 车票退款过滤器 38 | */ 39 | TRAIN_REFUND_TICKET_FILTER 40 | } 41 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dao/mapper/CarriageMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.dao.mapper; 19 | 20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 21 | import org.opengoofy.index12306.biz.ticketservice.dao.entity.CarriageDO; 22 | 23 | /** 24 | * 车厢实体 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public interface CarriageMapper extends BaseMapper { 28 | } 29 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dao/mapper/RegionMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.dao.mapper; 19 | 20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 21 | import org.opengoofy.index12306.biz.ticketservice.dao.entity.RegionDO; 22 | 23 | /** 24 | * 地区持久层 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public interface RegionMapper extends BaseMapper { 28 | } 29 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dao/mapper/StationMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.dao.mapper; 19 | 20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 21 | import org.opengoofy.index12306.biz.ticketservice.dao.entity.StationDO; 22 | 23 | /** 24 | * 车站持久层 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public interface StationMapper extends BaseMapper { 28 | } 29 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dao/mapper/TicketMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.dao.mapper; 19 | 20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 21 | import org.opengoofy.index12306.biz.ticketservice.dao.entity.TicketDO; 22 | 23 | /** 24 | * 车票持久层 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public interface TicketMapper extends BaseMapper { 28 | } 29 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dao/mapper/TrainMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.dao.mapper; 19 | 20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 21 | import org.opengoofy.index12306.biz.ticketservice.dao.entity.TrainDO; 22 | 23 | /** 24 | * 列车持久层 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public interface TrainMapper extends BaseMapper { 28 | } 29 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dao/mapper/TrainStationMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.dao.mapper; 19 | 20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 21 | import org.opengoofy.index12306.biz.ticketservice.dao.entity.TrainStationDO; 22 | 23 | /** 24 | * 列车站点持久层 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public interface TrainStationMapper extends BaseMapper { 28 | } 29 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dao/mapper/TrainStationPriceMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.dao.mapper; 19 | 20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 21 | import org.opengoofy.index12306.biz.ticketservice.dao.entity.TrainStationPriceDO; 22 | 23 | /** 24 | * 列车站点价格持久层 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public interface TrainStationPriceMapper extends BaseMapper { 28 | } 29 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dao/mapper/TrainStationRelationMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.dao.mapper; 19 | 20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 21 | import org.opengoofy.index12306.biz.ticketservice.dao.entity.TrainStationRelationDO; 22 | 23 | /** 24 | * 列车站点关系持久层 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public interface TrainStationRelationMapper extends BaseMapper { 28 | } 29 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dto/domain/PurchaseTicketPassengerDetailDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.dto.domain; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 购票乘车人详情实体 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | @Data 27 | public class PurchaseTicketPassengerDetailDTO { 28 | 29 | /** 30 | * 乘车人 ID 31 | */ 32 | private String passengerId; 33 | 34 | /** 35 | * 座位类型 36 | */ 37 | private Integer seatType; 38 | } 39 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dto/domain/RouteDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.dto.domain; 19 | 20 | import lombok.AllArgsConstructor; 21 | import lombok.Data; 22 | import lombok.NoArgsConstructor; 23 | 24 | /** 25 | * 站点路线实体 26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 27 | */ 28 | @Data 29 | @NoArgsConstructor 30 | @AllArgsConstructor 31 | public class RouteDTO { 32 | 33 | /** 34 | * 出发站点 35 | */ 36 | private String startStation; 37 | 38 | /** 39 | * 目的站点 40 | */ 41 | private String endStation; 42 | } 43 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dto/domain/SeatTypeCountDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.dto.domain; 19 | 20 | import lombok.AllArgsConstructor; 21 | import lombok.Data; 22 | import lombok.NoArgsConstructor; 23 | 24 | /** 25 | * 座位类型和座位数量实体 26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 27 | */ 28 | @Data 29 | @NoArgsConstructor 30 | @AllArgsConstructor 31 | public class SeatTypeCountDTO { 32 | 33 | /** 34 | * 座位类型 35 | */ 36 | private Integer seatType; 37 | 38 | /** 39 | * 座位类型 - 对应数量 40 | */ 41 | private Integer seatCount; 42 | } 43 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dto/req/CancelTicketOrderReqDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.dto.req; 19 | 20 | import lombok.AllArgsConstructor; 21 | import lombok.Data; 22 | import lombok.NoArgsConstructor; 23 | 24 | /** 25 | * 取消车票订单请求入参 26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 27 | */ 28 | @Data 29 | @NoArgsConstructor 30 | @AllArgsConstructor 31 | public class CancelTicketOrderReqDTO { 32 | 33 | /** 34 | * 订单号 35 | */ 36 | private String orderSn; 37 | } 38 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dto/req/RefundTicketReqDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.dto.req; 19 | 20 | import lombok.Data; 21 | 22 | import java.util.List; 23 | 24 | /** 25 | * 车票退款请求入参数实体 26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 27 | */ 28 | @Data 29 | public class RefundTicketReqDTO { 30 | 31 | /** 32 | * 订单号 33 | */ 34 | private String orderSn; 35 | 36 | /** 37 | * 退款类型 0 部分退款 1 全部退款 38 | */ 39 | private Integer type; 40 | 41 | /** 42 | * 部分退款子订单记录id集合 43 | */ 44 | private List subOrderRecordIdReqList; 45 | } 46 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dto/req/RegionStationQueryReqDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.dto.req; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 地区&站点查询请求入参 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | @Data 27 | public class RegionStationQueryReqDTO { 28 | 29 | /** 30 | * 查询方式 31 | */ 32 | private Integer queryType; 33 | 34 | /** 35 | * 名称 36 | */ 37 | private String name; 38 | } 39 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dto/req/TicketOrderItemQueryReqDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.dto.req; 19 | 20 | import lombok.Data; 21 | import java.util.List; 22 | 23 | /** 24 | * 车票子订单查询 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | @Data 28 | public class TicketOrderItemQueryReqDTO { 29 | 30 | /** 31 | * 订单号 32 | */ 33 | private String orderSn; 34 | 35 | /** 36 | * 子订单记录id 37 | */ 38 | private List orderItemRecordIds; 39 | } 40 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dto/resp/RefundTicketRespDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.dto.resp; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 车票退款返回详情实体 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | @Data 27 | public class RefundTicketRespDTO { 28 | } 29 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dto/resp/RegionStationQueryRespDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.dto.resp; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 地区&站点分页查询响应参数 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | @Data 27 | public class RegionStationQueryRespDTO { 28 | 29 | /** 30 | * 名称 31 | */ 32 | private String name; 33 | 34 | /** 35 | * 地区编码 36 | */ 37 | private String code; 38 | 39 | /** 40 | * 拼音 41 | */ 42 | private String spell; 43 | } 44 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dto/resp/StationQueryRespDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.dto.resp; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 站点分页查询响应参数 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | @Data 27 | public class StationQueryRespDTO { 28 | 29 | /** 30 | * 名称 31 | */ 32 | private String name; 33 | 34 | /** 35 | * 地区编码 36 | */ 37 | private String code; 38 | 39 | /** 40 | * 拼音 41 | */ 42 | private String spell; 43 | 44 | /** 45 | * 城市名称 46 | */ 47 | private String regionName; 48 | } 49 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dto/resp/TicketPurchaseRespDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.dto.resp; 19 | 20 | import lombok.AllArgsConstructor; 21 | import lombok.Builder; 22 | import lombok.Data; 23 | import lombok.NoArgsConstructor; 24 | 25 | import java.util.List; 26 | 27 | /** 28 | * 车票购买返回参数 29 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 30 | */ 31 | @Data 32 | @AllArgsConstructor 33 | @NoArgsConstructor 34 | @Builder 35 | public class TicketPurchaseRespDTO { 36 | 37 | /** 38 | * 订单号 39 | */ 40 | private String orderSn; 41 | 42 | /** 43 | * 乘车人订单详情 44 | */ 45 | private List ticketOrderDetails; 46 | } 47 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/remote/dto/PayInfoRespDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.remote.dto; 19 | 20 | import lombok.Data; 21 | 22 | import java.util.Date; 23 | 24 | /** 25 | * 支付单详情信息返回参数 26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 27 | */ 28 | @Data 29 | public class PayInfoRespDTO { 30 | 31 | /** 32 | * 订单号 33 | */ 34 | private String orderSn; 35 | 36 | /** 37 | * 支付总金额 38 | */ 39 | private Integer totalAmount; 40 | 41 | /** 42 | * 支付状态 43 | */ 44 | private Integer status; 45 | 46 | /** 47 | * 支付时间 48 | */ 49 | private Date gmtPayment; 50 | } 51 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/remote/dto/RefundRespDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.remote.dto; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 退款详情返回参数实体 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | @Data 27 | public class RefundRespDTO { 28 | } 29 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/service/CarriageService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.service; 19 | 20 | import java.util.List; 21 | 22 | /** 23 | * 列车车厢接口层 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | public interface CarriageService { 27 | 28 | /** 29 | * 查询列车车厢号集合 30 | * 31 | * @param trainId 列车 ID 32 | * @param carriageType 车厢类型 33 | * @return 车厢号集合 34 | */ 35 | List listCarriageNumber(String trainId, Integer carriageType); 36 | } 37 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/service/handler/ticket/base/IPurchaseTicket.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.service.handler.ticket.base; 19 | 20 | /** 21 | * 购票顶级抽象接口,为后续火车、高铁、汽车、飞机等出行工具规定行为约束 22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 23 | */ 24 | public interface IPurchaseTicket { 25 | } 26 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/service/handler/ticket/base/TrainBitMapCheckSeat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.service.handler.ticket.base; 19 | 20 | /** 21 | * 高铁验证座位接口 22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 23 | */ 24 | public interface TrainBitMapCheckSeat extends BitMapCheckSeat { 25 | } 26 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/service/handler/ticket/dto/TokenResultDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.ticketservice.service.handler.ticket.dto; 19 | 20 | import lombok.AllArgsConstructor; 21 | import lombok.Builder; 22 | import lombok.Data; 23 | import lombok.NoArgsConstructor; 24 | 25 | import java.util.List; 26 | 27 | /** 28 | * 令牌扣减返回参数 29 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 30 | */ 31 | @Data 32 | @NoArgsConstructor 33 | @AllArgsConstructor 34 | @Builder 35 | public class TokenResultDTO { 36 | 37 | /** 38 | * Token 为空 39 | */ 40 | private Boolean tokenIsNull; 41 | 42 | /** 43 | * 获取 Token 为空站点座位类型和数量 44 | */ 45 | private List tokenIsNullSeatTypeCounts; 46 | } 47 | -------------------------------------------------------------------------------- /services/ticket-service/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | # RocketMQ 2.2.3 version does not adapt to SpringBoot3 2 | org.apache.rocketmq.spring.autoconfigure.RocketMQAutoConfiguration -------------------------------------------------------------------------------- /services/ticket-service/src/main/resources/lua/ticket_availability_rollback_token_bucket.lua: -------------------------------------------------------------------------------- 1 | local inputString = KEYS[2] 2 | local actualKey = inputString 3 | local colonIndex = string.find(actualKey, ":") 4 | if colonIndex ~= nil then 5 | actualKey = string.sub(actualKey, colonIndex + 1) 6 | end 7 | 8 | local jsonArrayStr = ARGV[1] 9 | local jsonArray = cjson.decode(jsonArrayStr) 10 | local alongJsonArrayStr = ARGV[2] 11 | local alongJsonArray = cjson.decode(alongJsonArrayStr) 12 | 13 | for index, jsonObj in ipairs(jsonArray) do 14 | local seatType = tonumber(jsonObj.seatType) 15 | local count = tonumber(jsonObj.count) 16 | for indexTwo, alongJsonObj in ipairs(alongJsonArray) do 17 | local startStation = tostring(alongJsonObj.startStation) 18 | local endStation = tostring(alongJsonObj.endStation) 19 | local actualInnerHashKey = startStation .. "_" .. endStation .. "_" .. seatType 20 | local ticketSeatAvailabilityTokenValue = tonumber(redis.call('hget', KEYS[1], tostring(actualInnerHashKey))) 21 | if ticketSeatAvailabilityTokenValue >= 0 then 22 | redis.call('hincrby', KEYS[1], tostring(actualInnerHashKey), count) 23 | end 24 | end 25 | end 26 | 27 | return 0 28 | -------------------------------------------------------------------------------- /services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/UserServiceApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.userservice; 19 | 20 | import org.mybatis.spring.annotation.MapperScan; 21 | import org.springframework.boot.SpringApplication; 22 | import org.springframework.boot.autoconfigure.SpringBootApplication; 23 | 24 | /** 25 | * 用户服务应用启动器 26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 27 | */ 28 | @SpringBootApplication 29 | @MapperScan("org.opengoofy.index12306.biz.userservice.dao.mapper") 30 | public class UserServiceApplication { 31 | 32 | public static void main(String[] args) { 33 | SpringApplication.run(UserServiceApplication.class, args); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/common/constant/Index12306Constant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.userservice.common.constant; 19 | 20 | /** 21 | * 系统级公共常量 22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 23 | */ 24 | public final class Index12306Constant { 25 | 26 | /** 27 | * 用户注册可复用用户名分片数 28 | */ 29 | public static final int USER_REGISTER_REUSE_SHARDING_COUNT = 1024; 30 | } 31 | -------------------------------------------------------------------------------- /services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/common/enums/UserChainMarkEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.userservice.common.enums; 19 | 20 | /** 21 | * 用户相关责任链 Mark 枚举 22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 23 | */ 24 | public enum UserChainMarkEnum { 25 | 26 | /** 27 | * 用户注册过滤器 28 | */ 29 | USER_REGISTER_FILTER 30 | } 31 | -------------------------------------------------------------------------------- /services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/common/enums/VerifyStatusEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.userservice.common.enums; 19 | 20 | import lombok.AllArgsConstructor; 21 | import lombok.Getter; 22 | 23 | /** 24 | * 用户注册错误码枚举 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | @AllArgsConstructor 28 | public enum VerifyStatusEnum { 29 | 30 | /** 31 | * 未审核 32 | */ 33 | UNREVIEWED(0), 34 | 35 | /** 36 | * 已审核 37 | */ 38 | REVIEWED(1); 39 | 40 | @Getter 41 | private final int code; 42 | } 43 | -------------------------------------------------------------------------------- /services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dao/entity/UserReuseDO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.userservice.dao.entity; 19 | 20 | import com.baomidou.mybatisplus.annotation.TableName; 21 | import lombok.AllArgsConstructor; 22 | import lombok.Data; 23 | import lombok.NoArgsConstructor; 24 | import org.opengoofy.index12306.framework.starter.database.base.BaseDO; 25 | 26 | /** 27 | * 用户名复用表实体 28 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 29 | */ 30 | @Data 31 | @NoArgsConstructor 32 | @AllArgsConstructor 33 | @TableName("t_user_reuse") 34 | public final class UserReuseDO extends BaseDO { 35 | 36 | /** 37 | * 用户名 38 | */ 39 | private String username; 40 | } 41 | -------------------------------------------------------------------------------- /services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dao/mapper/PassengerMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.userservice.dao.mapper; 19 | 20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 21 | import org.opengoofy.index12306.biz.userservice.dao.entity.PassengerDO; 22 | 23 | /** 24 | * 乘车人持久层 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public interface PassengerMapper extends BaseMapper { 28 | } 29 | -------------------------------------------------------------------------------- /services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dao/mapper/UserDeletionMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.userservice.dao.mapper; 19 | 20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 21 | import org.opengoofy.index12306.biz.userservice.dao.entity.UserDeletionDO; 22 | 23 | /** 24 | * 用户注销表持久层 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public interface UserDeletionMapper extends BaseMapper { 28 | } 29 | -------------------------------------------------------------------------------- /services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dao/mapper/UserMailMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.userservice.dao.mapper; 19 | 20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 21 | import org.opengoofy.index12306.biz.userservice.dao.entity.UserMailDO; 22 | 23 | /** 24 | * 用户邮箱表持久层 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public interface UserMailMapper extends BaseMapper { 28 | 29 | /** 30 | * 注销用户 31 | * 32 | * @param userMailDO 注销用户入参 33 | */ 34 | void deletionUser(UserMailDO userMailDO); 35 | } 36 | -------------------------------------------------------------------------------- /services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dao/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.userservice.dao.mapper; 19 | 20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 21 | import org.opengoofy.index12306.biz.userservice.dao.entity.UserDO; 22 | 23 | /** 24 | * 用户信息持久层 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public interface UserMapper extends BaseMapper { 28 | 29 | /** 30 | * 注销用户 31 | * 32 | * @param userDO 注销用户入参 33 | */ 34 | void deletionUser(UserDO userDO); 35 | } 36 | -------------------------------------------------------------------------------- /services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dao/mapper/UserPhoneMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.userservice.dao.mapper; 19 | 20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 21 | import org.opengoofy.index12306.biz.userservice.dao.entity.UserPhoneDO; 22 | 23 | /** 24 | * 用户手机号持久层 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public interface UserPhoneMapper extends BaseMapper { 28 | 29 | /** 30 | * 注销用户 31 | * 32 | * @param userPhoneDO 注销用户入参 33 | */ 34 | void deletionUser(UserPhoneDO userPhoneDO); 35 | } 36 | -------------------------------------------------------------------------------- /services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dao/mapper/UserReuseMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.userservice.dao.mapper; 19 | 20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 21 | import org.opengoofy.index12306.biz.userservice.dao.entity.UserReuseDO; 22 | 23 | /** 24 | * 用户名复用持久层 25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 26 | */ 27 | public interface UserReuseMapper extends BaseMapper { 28 | } 29 | -------------------------------------------------------------------------------- /services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dto/req/PassengerRemoveReqDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.userservice.dto.req; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 乘车人移除请求参数 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | @Data 27 | public class PassengerRemoveReqDTO { 28 | 29 | /** 30 | * 乘车人id 31 | */ 32 | private String id; 33 | } 34 | -------------------------------------------------------------------------------- /services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dto/req/PassengerReqDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.userservice.dto.req; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 乘车人添加&修改请求参数 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | @Data 27 | public class PassengerReqDTO { 28 | 29 | /** 30 | * 乘车人id 31 | */ 32 | private String id; 33 | 34 | /** 35 | * 真实姓名 36 | */ 37 | private String realName; 38 | 39 | /** 40 | * 证件类型 41 | */ 42 | private Integer idType; 43 | 44 | /** 45 | * 证件号码 46 | */ 47 | private String idCard; 48 | 49 | /** 50 | * 优惠类型 51 | */ 52 | private Integer discountType; 53 | 54 | /** 55 | * 手机号 56 | */ 57 | private String phone; 58 | } 59 | -------------------------------------------------------------------------------- /services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dto/req/UserDeletionReqDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.userservice.dto.req; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 用户注销请求参数 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | @Data 27 | public class UserDeletionReqDTO { 28 | 29 | /** 30 | * 用户名 31 | */ 32 | private String username; 33 | } 34 | -------------------------------------------------------------------------------- /services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dto/req/UserLoginReqDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.userservice.dto.req; 19 | 20 | import lombok.AllArgsConstructor; 21 | import lombok.Data; 22 | import lombok.NoArgsConstructor; 23 | 24 | /** 25 | * 用户登录请求参数 26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 27 | */ 28 | @Data 29 | @NoArgsConstructor 30 | @AllArgsConstructor 31 | public class UserLoginReqDTO { 32 | 33 | /** 34 | * 用户名 35 | */ 36 | private String usernameOrMailOrPhone; 37 | 38 | /** 39 | * 密码 40 | */ 41 | private String password; 42 | } 43 | -------------------------------------------------------------------------------- /services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dto/req/UserUpdateReqDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.userservice.dto.req; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 用户修改请求参数 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | @Data 27 | public class UserUpdateReqDTO { 28 | 29 | /** 30 | * 用户ID 31 | */ 32 | private String id; 33 | 34 | /** 35 | * 用户名 36 | */ 37 | private String username; 38 | 39 | /** 40 | * 邮箱 41 | */ 42 | private String mail; 43 | 44 | /** 45 | * 旅客类型 46 | */ 47 | private Integer userType; 48 | 49 | /** 50 | * 邮编 51 | */ 52 | private String postCode; 53 | 54 | /** 55 | * 地址 56 | */ 57 | private String address; 58 | } 59 | -------------------------------------------------------------------------------- /services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dto/resp/UserLoginRespDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.userservice.dto.resp; 19 | 20 | import lombok.AllArgsConstructor; 21 | import lombok.Data; 22 | import lombok.NoArgsConstructor; 23 | 24 | /** 25 | * 用户登录返回参数 26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 27 | */ 28 | @Data 29 | @NoArgsConstructor 30 | @AllArgsConstructor 31 | public class UserLoginRespDTO { 32 | 33 | /** 34 | * 用户 ID 35 | */ 36 | private String userId; 37 | 38 | /** 39 | * 用户名 40 | */ 41 | private String username; 42 | 43 | /** 44 | * 真实姓名 45 | */ 46 | private String realName; 47 | 48 | /** 49 | * Token 50 | */ 51 | private String accessToken; 52 | } 53 | -------------------------------------------------------------------------------- /services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dto/resp/UserRegisterRespDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.userservice.dto.resp; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 用户注册返回参数 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | @Data 27 | public class UserRegisterRespDTO { 28 | 29 | /** 30 | * 用户名 31 | */ 32 | private String username; 33 | 34 | /** 35 | * 真实姓名 36 | */ 37 | private String realName; 38 | 39 | /** 40 | * 手机号 41 | */ 42 | private String phone; 43 | } 44 | -------------------------------------------------------------------------------- /services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/toolkit/UserReuseUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.opengoofy.index12306.biz.userservice.toolkit; 19 | 20 | import static org.opengoofy.index12306.biz.userservice.common.constant.Index12306Constant.USER_REGISTER_REUSE_SHARDING_COUNT; 21 | 22 | /** 23 | * 用户名可复用工具类 24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料 25 | */ 26 | public final class UserReuseUtil { 27 | 28 | /** 29 | * 计算分片位置 30 | */ 31 | public static int hashShardingIdx(String username) { 32 | return Math.abs(username.hashCode() % USER_REGISTER_REUSE_SHARDING_COUNT); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /services/user-service/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | 2 | server: 3 | port: 9001 4 | 5 | spring: 6 | application: 7 | name: index12306-user${unique-name:}-service 8 | datasource: 9 | driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver 10 | url: jdbc:shardingsphere:classpath:shardingsphere-config.yaml 11 | data: 12 | redis: 13 | host: 127.0.0.1 14 | port: 6379 15 | password: 123456 16 | cloud: 17 | nacos: 18 | discovery: 19 | server-addr: 127.0.0.1:8848 20 | password: nacos 21 | username: nacos 22 | sentinel: 23 | transport: 24 | dashboard: localhost:8686 25 | port: 8719 26 | mybatis-plus: 27 | global-config: 28 | db-config: 29 | logic-delete-field: delFlag 30 | logic-delete-value: 1 31 | logic-not-delete-value: 0 32 | configuration: 33 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl 34 | 35 | framework: 36 | fastjson: 37 | safa-mode: true 38 | cache: 39 | redis: 40 | value-timeout: 50000 41 | bloom-filter: 42 | user-register: 43 | name: user_register_cache_penetration_bloom_filter${unique-name:} 44 | 45 | management: 46 | endpoints: 47 | web: 48 | exposure: 49 | include: '*' 50 | metrics: 51 | tags: 52 | application: ${spring.application.name} 53 | -------------------------------------------------------------------------------- /services/user-service/src/main/resources/mapper/UserMailMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | update t_user_mail 25 | set deletion_time = #{deletionTime}, 26 | del_flag = '1' 27 | where mail = #{mail} 28 | and del_flag = '0' 29 | 30 | -------------------------------------------------------------------------------- /services/user-service/src/main/resources/mapper/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | update t_user 25 | set deletion_time = #{deletionTime}, 26 | del_flag = '1' 27 | where username = #{username} and del_flag = '0' 28 | 29 | -------------------------------------------------------------------------------- /services/user-service/src/main/resources/mapper/UserPhoneMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | update t_user_phone 25 | set deletion_time = #{deletionTime}, 26 | del_flag = '1' 27 | where phone = #{phone} 28 | and del_flag = '0' 29 | 30 | -------------------------------------------------------------------------------- /tests/general/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.opengoofy.index12306 7 | index12306-tests 8 | 0.0.1-SNAPSHOT 9 | 10 | 11 | index12306-general-test 12 | 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter 17 | 18 | 19 | 20 | org.springframework.boot 21 | spring-boot-starter-test 22 | test 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /tests/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.opengoofy.index12306 7 | index12306-all 8 | 0.0.1-SNAPSHOT 9 | 10 | 11 | index12306-tests 12 | pom 13 | 14 | 15 | general 16 | 17 | 18 | --------------------------------------------------------------------------------